Short Palindrome Discussions | Algorithms | HackerRank
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.
M8... if you are getting error for test cases 30-37, even after using unsigned long long everywhere, start taking modulo one trillion and 7 for your array numbers. It really helps with the overflow and all that.
Here is my solution (passes everything) using that popular DP stackoverflow link. All this optimization making me crazy.
Short Palindrome
You are viewing a single comment's thread. Return to all comments →
M8... if you are getting error for test cases 30-37, even after using unsigned long long everywhere, start taking modulo one trillion and 7 for your array numbers. It really helps with the overflow and all that.
Here is my solution (passes everything) using that popular DP stackoverflow link. All this optimization making me crazy.
CPP: