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.
Note that I omitted the modulo operations. All you need is some matrices. The result is the sum of the elements in c4.
True, in Python this solution times out, but it's nonsense. Python has its limitations and we all know that. Use PyPy when needed. Also, the C++ version of the code above gets in with no problem.
Remember: use the best tool for the problem, don't force yourself to only use Python or only use C++ or some other language.
Short Palindrome
You are viewing a single comment's thread. Return to all comments →
This is really simple. Check out the idea below.
Note that I omitted the modulo operations. All you need is some matrices. The result is the sum of the elements in
c4
.True, in Python this solution times out, but it's nonsense. Python has its limitations and we all know that. Use PyPy when needed. Also, the C++ version of the code above gets in with no problem.
Remember: use the best tool for the problem, don't force yourself to only use Python or only use C++ or some other language.