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
- Strings
- Palindrome Index
- Discussions
Palindrome Index
Palindrome Index
Sort by
recency
|
1099 Discussions
|
Please Login in order to post a comment
O(n) c++ solution:
Here is my c++ solution : explanation here https://youtu.be/QjHpvMdfnqs,
My Java solution:
the solution is: def ispalindromes(s): return s==s[::-1]
def palindromeIndex(s): n=len(s) if ispalindromes(s): return -1
My Python solution doesn't pass many of the testcases! Can anyone help?