how do you parse the tree? You can solve this problem without having to build explicit tree data structure. You can just tokenize the tree string, and then have a simple recursive method that computes probability for each animal.
On Sep 12, 2:34 pm, "[email protected]" <[email protected]> wrote: > Missed it by 23 spots =[[[[. > I solved A-small and then began to solve A-large. > I was using eval() in python to parse the tree. > On the large input it gave me a memory error! > > Is there anything I could have done besides parsing the tree manually > or do I deserve this since I was lazy and used eval()? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-codejam" 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/google-code?hl=en -~----------~----~----~----~------~----~------~--~---
