On Tuesday, April 18, 2017 at 9:50:58 AM UTC-4, Luke Pebody wrote: > All letters in the input data must be distinct. Your case has 2 Gs > > > On 18 Apr 2017 2:39 p.m., "varun vats" <[email protected]> wrote: > > > In Question : Alphabet Cake, > > The greedy Large approach: > > > > There is a simple non-recursive approach as well. First, within each row, we > can extend each existing letter into all cells to the right of that letter, > until we reach another existing letter or the edge of the cake. Then, we can > extend the leftmost existing letter (if any) into all cells to the left of > that letter. > > > > Would give wrong answer for the below test case. > > > > > > Test Case: > > 1 > > 2 4 > > G ? ? K > > ? G R ? > > > > According to the mentioned greedy approach : > > > > G G G K > > G G R R > > > > Here the G is not rectangular. > > > > Correct answer could have been : > > > > G G K K > > G G R R > > > > > > Please team let me know if I am missing something. > > > > -- > > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To post to this group, send email to [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/98239779-d1dd-42b1-8bf0-c4151e135527%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout.
I must admit that I, too, wasted an hour trying to solve this harder problem. When I finally reread the problem statement and realized all given letters were distinct, I solved it fairly quickly. But I had wasted so much time, I hadn't enough time left to solve any others. Now I know I have to work on both my algo skills *and* my reading comprehension. :( -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/fd0e3ee3-cc60-4714-b94a-3c8a3db09bbb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
