Valid Palindrome – LeetCode 125
Problem
Description
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
Answer
Original
Code
1 | class Solution { |
思路
简单的头尾同时遍历比对,时间复杂度$O(n)$,空间复杂度$O(1)$。
Better
思路
没看到更好的