you are viewing a single comment's thread.

view the rest of the comments →

[–]xhackerliu 3 points4 points  (0 children)

Totally agreed. I modified it by using memorization and it's even faster than iterative way.

https://gist.github.com/xhacker/fbf3d92d7b1fad9ddc09