xphoniex / Google-Foobar

Google Foobar challenge 2017
MIT License
54 stars 30 forks source link

Help with Grandest Staircase of them all #9

Closed rafid009 closed 6 years ago

rafid009 commented 6 years ago

I am currently stuck on Level 3 final challenge. I tried to use DP to solve it. The strategy I used to use 2D matrix and make its row the height of the first step and column the rest. and then I used sum of all row-column combinations which makes the number n. But by using this, only 2 tasks is passed, rest of them fails. I think I need to use a different strategy. Would you help me?

rafid009 commented 6 years ago

I've already solved the problem using a generating function and DP. My first approach was naive, It was partition problem. took some time to realize it. So I am closing this issue.