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'm unable to understand your last statement.
"along with the fact that if sum of first 2 terms exceeds limit till you have to search palindrome(N), you should break the loop" ?
Are you following brute force approach to compute sigma(a^2(n,d)) for all possible combinations of a,n.
Or are you using some pruning strategry by prestoring all possible palindromes. and looking for few combinations for a,n that will get to the desired palindrome.
Thanks for the post.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #125: Palindromic sums
You are viewing a single comment's thread. Return to all comments →
I'm unable to understand your last statement. "along with the fact that if sum of first 2 terms exceeds limit till you have to search palindrome(N), you should break the loop" ?
Are you following brute force approach to compute sigma(a^2(n,d)) for all possible combinations of a,n. Or are you using some pruning strategry by prestoring all possible palindromes. and looking for few combinations for a,n that will get to the desired palindrome. Thanks for the post.