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.
- Prepare
- Algorithms
- Search
- Short Palindrome
- Discussions
Short Palindrome
Short Palindrome
Sort by
recency
|
64 Discussions
|
Please Login in order to post a comment
Python 3 solution
This problem is similar to Count Triplets
import string
from collections import defaultdict
def shortPalindrome(s): # Write your code here
standard dynamic programming algo, O(n), but uses a lot of memory (couple hundred MBs). pass all test
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )