I think this problem can be reduced to: For a particular element in Superblock, find all the subblocks which contains next element or the NULL. For example, take first element i.e. 7, we need to find all the blocks which has 7 and has 3 or NULL as its next element in the subblock.
Now suppose in first iteration, we found n1 subblocks which has either 7 or 7 and 3 (consecutively), If the next element is NULL, we include this subblock in final count otherwise we keep these subblocks for next iteration because subblock which are bad for first element are not good for other elements also. Thanks, On Sun, Dec 6, 2009 at 9:11 AM, Aditya Shankar <[email protected] > wrote: > Hi, > Consider the sequence 1,2,3,4,5,6...,n. There are n^2 blocks, so the > question may not be correct. > > > Regards > Aditya Shankar > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Dinesh Bansal The Law of Win says, "Let's not do it your way or my way; let's do it the best way." -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
