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
|
1067 Discussions
|
Please Login in order to post a comment
Here's my solution to this problem in JS:
Passing all tests, in JS, in O(n) time. Not very elegant, but easy to reason about:
my python code pass all the tests
def palindromeIndex(s): def if_pand(s): left = 0 right = len(s) - 1
Here is my c++ solution : explanation here https://youtu.be/QjHpvMdfnqs,
Pretty shocked at how many solutions think abcddc is a palindrome if you remove the last c. Maybe these tests need to be better.