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.
I don't know if it's just me, but the test cases for later problems are getting more annoying associated with minor issues of handling large numbers.
Anyway, I've got an solution for this problem. To arrive at the answer skipping the unneccessary intermediate steps, generate a list of all 's at the beginning (and this is where Python fails on the server without modulo, but not on my machine). It can be achieved easily if you observe the cases for odd and even separately.
After that, to get to the answer is just a matter of accumulating those 's. You are just one step away when you have the highest element of the answer.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #103: Special subset sums: optimum
You are viewing a single comment's thread. Return to all comments →
I don't know if it's just me, but the test cases for later problems are getting more annoying associated with minor issues of handling large numbers.
Anyway, I've got an solution for this problem. To arrive at the answer skipping the unneccessary intermediate steps, generate a list of all 's at the beginning (and this is where Python fails on the server without modulo, but not on my machine). It can be achieved easily if you observe the cases for odd and even separately.
After that, to get to the answer is just a matter of accumulating those 's. You are just one step away when you have the highest element of the answer.