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.
Example 1:
1 | Input: "A man, a plan, a canal: Panama" |
Example 2:
1 | Input: "race a car" |
判斷是不是回文,把字串去掉大小寫跟符號,比對反轉是否相同就可以了。
1 | T: O(1), S: O(1) |
如果你覺得這篇文章很棒,請你不吝點讚 (゚∀゚)