We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This problem permits a really short recursive solution.
Generally I prefer non-recursive approaches, as recursion tends to be slow (even with memo) and recursion depth limits may apply.
However recursive solutions give more concise and elegant code.
Stone Division, Revisited
You are viewing a single comment's thread. Return to all comments →
This problem permits a really short recursive solution.
Generally I prefer non-recursive approaches, as recursion tends to be slow (even with memo) and recursion depth limits may apply. However recursive solutions give more concise and elegant code.
Python3: