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.
Finally, got this using grundy numbers again. This is little complicated due to long numbers required for N and factors. Grundy numbers are still integers only. Also two of the test cases failed initially forcing me to use a Map for storing the grundy numbers during calculation. That solved all the test cases.
Stone Division
You are viewing a single comment's thread. Return to all comments →
Finally, got this using grundy numbers again. This is little complicated due to long numbers required for N and factors. Grundy numbers are still integers only. Also two of the test cases failed initially forcing me to use a Map for storing the grundy numbers during calculation. That solved all the test cases.