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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
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.