LeetCode Note Java 00125:Valid Palindrome
判斷將字串除去符號與轉成小寫後是否回文。
題目
Valid Palindrome Easy
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
Given a string s, return true if it is a palindrome, or false otherwise.
我的解法
1 | class Solution { |
重點物件或方法
Character.isLetterOrDigit()
檢討
最難的就是判斷是不是符號,如果不會這個方法就很難寫出來。