# 125 Valid Palindrome
string 本身可以直接抓值,不用再轉 Array, eg. name ="hannah", name[0] = "h" / 基本 Regex 要很熟練
Given a string, determine if it is a palindrome,
considering only alphanumeric characters and ignoring cases.
Note: For the purpose of this problem, we define empty string as valid palindrome.
input: 可以呼略大小寫跟空白Example 1:
Input: "A man, a plan, a canal: Panama"
Output: true
Example 2:
Input: "race a car"
Output: false
/**
* @param {string} s
* @return {boolean}
*/
var isPalindrome = function(s) {}怎麼解
學到什麼?
Last updated