Solution for https://oj.leetcode.com/problems/valid-palindrome/