anmolsainiii23's blog

By anmolsainiii23, history, 3 years ago, In English

Hi I was wondering why can't we use recursive Solution for Coin Piles Solution. This is the Problem

I have tried recursive solution but end up getting TLE and Runtime Error. Can anyone explain whether we can use Recursion or Dynamic Programing. This is my Solution.

This is my Soluion

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
3 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

See the constraint on a, b (1e9). It seems yours code taking O(ab) time and memory