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.
Hi, this problem is frustrating me to no end. I don't want to post my code here to avoid spoilers, but any suggestions why 5 out of the 16 test cases could fail (7, 10, 11, 12 and 16) while the rest passes happily. When comparing my output with the expected one, I see that the first several thousand lines are correct but then i am having a few additional sums in my results list that are missing from the expected output. E.g. in test case 10 I produce one more 129, one more 127, one more 91, etc than expected. I can't figure out the flaw in my algorithm. Any ideas?
Thanks a lot!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Order exercises
You are viewing a single comment's thread. Return to all comments →
Hi, this problem is frustrating me to no end. I don't want to post my code here to avoid spoilers, but any suggestions why 5 out of the 16 test cases could fail (7, 10, 11, 12 and 16) while the rest passes happily. When comparing my output with the expected one, I see that the first several thousand lines are correct but then i am having a few additional sums in my results list that are missing from the expected output. E.g. in test case 10 I produce one more 129, one more 127, one more 91, etc than expected. I can't figure out the flaw in my algorithm. Any ideas?
Thanks a lot!