You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two pointers to check if s is a palindrome. When it's not a palindrome, skip one char either from left or right to see if it still forms a palindrome. Return true if it's a palindrome else false
*/
class Solution {
public boolean validPalindrome(String s) {
if(s.length()==0) return false;
int left = 0, right = s.length()-1;
while(left <= right && s.charAt(left) == s.charAt(right))