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.
Really liked the problem.
But for the one test case which is 7 1 ? I had to cheat a bit. I am using JAVA and in the test environment I got the test passing in 2.8 seconds although sometimes it also timedout but in grading it timedout every time.
I had rewritten a lot of logic just for the one test case yet it still was not enough. As I had no ideas on how to improve more. Based on the answer from test environment for 7 1 I just limited the prime count to be analysed. That enabled me to pass the case.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #51: Prime digit replacements
You are viewing a single comment's thread. Return to all comments →
Really liked the problem. But for the one test case which is 7 1 ? I had to cheat a bit. I am using JAVA and in the test environment I got the test passing in 2.8 seconds although sometimes it also timedout but in grading it timedout every time.
I had rewritten a lot of logic just for the one test case yet it still was not enough. As I had no ideas on how to improve more. Based on the answer from test environment for 7 1 I just limited the prime count to be analysed. That enabled me to pass the case.