@Vikas, I think the brute force here will be combinatorial , you need to calculate all the combinations of lucky say 4, 7, 47, 74 .... and then try to find all of the moves combination which maximize this lucky array index, may be from last to first, just for little optimization. A bit tough for the interview ....:)
On Oct 30, 7:48 pm, aniket chatterjee <[email protected]> wrote: > +1 > > On Sun, Oct 30, 2011 at 6:53 AM, Siddhartha Banerjee < > > [email protected]> wrote: > > could you please explain the question in a bit more detail? > > especially the part"There are some particular > > numbers which are made using 4 or 7 : any combination of 4 and 7 are > > accepted." > > > from what i understand of the question, there are some intervals given... > > we can move the intervals left or right by one unit, any such movement > > counts as one move... we have to move the segments in such a way that it > > maximizes the "maximum number of segments where a number can lie"...the > > maximum number of moves allowed are given... is that true??? > > > by the way, which company's coding round was it??? > > > -- > > 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. -- 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.
