Leetcode Valid Palindrome
来源:互联网 发布:淘宝怎么上传质检报告 编辑:程序博客网 时间:2024/06/06 05:08
日常打卡
public class Solution { public static boolean judge(char target){ if (target>='a'&&target<='z') { return true; } if (target>='0'&&target<='9') { return true; } return false; } public boolean isPalindrome(String s) { int len=s.length(); for(int i=0,j=0;i<len-j-1;){ char head=s.charAt(i); char tail=s.charAt(len-j-1); if(head>='A'&&head<='Z'){ head=(char) (head-'A'+'a'); } if(tail>='A'&&tail<='Z'){ tail=(char) (tail-'A'+'a'); } if(!judge(head)){ i++; continue; } if(!judge(tail)){ j++; continue; } if(head!=tail){ return false; } else{ i++;j++; } } return true; }}
0 0
- [Leetcode] Valid Palindrome
- Leetcode: Valid Palindrome
- leetcode 55: Valid Palindrome
- [LeetCode] Valid Palindrome
- 【leetcode】Valid Palindrome
- LeetCode - Valid Palindrome
- [leetcode]Valid Palindrome
- [LeetCode]Valid Palindrome
- [Leetcode]Valid Palindrome
- LeetCode-Valid Palindrome
- [leetcode] Valid Palindrome
- LeetCode 125: Valid Palindrome
- LeetCode - Valid Palindrome
- leetcode之Valid Palindrome
- LeetCode | Valid Palindrome
- [leetcode]Valid Palindrome
- 【leetcode】Valid Palindrome
- LeetCode题解:Valid Palindrome
- python多线程与线程同步
- 145.Binary Tree Postorder Traversal
- NVIDIA 的深度学习工具箱NVIDIA DIGITS:可视化训练
- 在JAVA中目录列表器file的应用及Matcher对象与Pattern对象的使用
- VMware11安装OS X10.10和xcode整理
- Leetcode Valid Palindrome
- [转]学JS必看
- 查验身份证(15)
- 一起学习 JPA(1)
- host,nslookup
- 打开Eclipse遇到Failed to create the Java Virtual Machine问题
- GUI--Swing组件(1)
- 有子对象该怎麽办
- 关键路径