Good ideas and conversation. No ads, no tracking. Login or Take a Tour!
I'm impressed you managed a solution for 3 coins. > count_change does get quite slow for n >> 10^6 (that's $10,000.00) From a pure math angle, both memo & dynamic programming versions are linear in time and space. As you said though, those numbers are growing exponentially meaning the space will grow exponentially too.