Need help optimizing solution

Правка en1, от aakarshmadhavan, 2018-07-13 00:55:11

I have a very interesting problem I feel you will all appreciate!

I have solved with brute force, but it is not fast enough. I am thinking I must use dynamic programming to help and I tried using memoization but still not fast enough.

Here is my code: Code link Java DP + recursion

Please give me sone hints how to make it faster (top down DP) or how to improve my code to get faster. Thank you

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский aakarshmadhavan 2018-07-13 00:55:11 541 Initial revision (published)