It can be done in O(n) space too using DP :) :). U dont need that flag, but that solution u said is absolutely correct. On Thu, Jan 20, 2011 at 7:27 PM, Decipher <[email protected]> wrote:
> There is a row of houses in which each house contains some amount of money. > Write an algorithm that loots the maximum amount of money from these houses. > The only restriction is that you cannot loot two houses that are directly > next to each other. > > -- > 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. > -- 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.
