Valid Palindrome Leetcode Javascript Practice