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 one is the first problem which I find the HackerRank version is easier than the default question, but maybe only because I hadn't evaluated a better algorithm yet.
The original involves finding the longest chain when M=4, which could mean checking every 4 digit combination. This gives you a combination and asks you to find its max length, significantly less computation.
After finding a way to generate every partition of the combination, and then a recursive means of evaluating all the potential values of any combination, and then dealing with some floating point rounding, it wasn't so bad. I wonder if the original question would still be harder.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #93: Arithmetic expressions
You are viewing a single comment's thread. Return to all comments →
This one is the first problem which I find the HackerRank version is easier than the default question, but maybe only because I hadn't evaluated a better algorithm yet.
The original involves finding the longest chain when M=4, which could mean checking every 4 digit combination. This gives you a combination and asks you to find its max length, significantly less computation.
After finding a way to generate every partition of the combination, and then a recursive means of evaluating all the potential values of any combination, and then dealing with some floating point rounding, it wasn't so bad. I wonder if the original question would still be harder.