Doesnt the time complexity seem to be a li'l large?? Looks like its taking
exponential time...
On Sun, Dec 19, 2010 at 5:01 PM, mohit ranjan shoonya.mo...@gmail.comwrote:
Let A[0..n] be the array
Step 1: Start from A[0] and find out the first element, beyond which array
in not sorted,
wouldn't your algo take n^3 time as well given the fact that the lists are
not sorted? searching for the matching value fr z should be taking O(n) time
and to do so for each pair of x and y shall take O(n^2).
Please correct me if i got something wrong here
On Wed, Dec 15, 2010 at 11:44 AM,
@Sravan
There seems to be a little problem in your solution. Your are probably
assuming that 75% of C is less than D after the condition that A is greater
than B while thats not the case according to the question.
My Solution -
Out of 5000 cases, AB in 3750 of them and CD in 3750 of them again.
I think ankur khanna's solution is appropriate. couldn't get what bittu was
trying to do completely.. could you just explain it once please!
On Wed, Dec 15, 2010 at 10:35 AM, Soumya Prasad Ukil
ukil.sou...@gmail.comwrote:
bittu, in stead of writing your code, put your logic here. It is not the
@aviral - could you please explain it a little further? i was unable to
interpret your solution
On Wed, Dec 15, 2010 at 10:32 AM, Soumya Prasad Ukil
ukil.sou...@gmail.comwrote:
Does it include both overlapping and non-overlapping strings?
On 14 December 2010 19:38, aviral gupta