Correctness to ValidPalindrome code