Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

Time Limit Exceeds - TASTR

$
0
0

Hello, I am pretty new to code chef, and had tried my first program over here. I just tried out this question: http://www.codechef.com/problems/TASTR

hmm.. as per the the explanation of the question, its quite unclear, as i have no idea about LCP and Suffix array. I just tried a simple approach and used dynamic arrays to prevent space wastage.

However, i got my time limit exceeded. here's my program: http://www.codechef.com/viewsolution/1968191

basically, i am scanning a string, and then breaking it in sub-strings and passing into a dynamically created 2D array. I believe its when the sub-strings are compared and looked for duplicate, its taking lots of time.

Could anyone suggest me a better method to ignore duplicate sub-strings?

Thanks


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>