【LeetCode】125. Valid Palindrome
发布时间:2020-12-13 21:19:02 所属栏目:PHP教程 来源:网络整理
导读:问题描写 Given a string,determine if it is a palindrome,considering only alphanumeric characters and ignoring cases. For example, "A man,a plan,a canal: Panama" is a palindrome. "race a car" is not a palindrome. Note: Have you consider tha
问题描写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. 回文字符串判断,但只判断字母和数字是不是构成回文字符串,标点符号被略过。 问题分析保存左右两个指针,每轮先移动左指针获得1个字母或数字,其它字符都跳过;然后移动右指针,找到1个字母或数字,其它字符都跳过;如果此时左右两个字符都为字母或数字并但是两个不相等,则返回 代码
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |