415
来源:互联网 发布:软件架构师程序员 编辑:程序博客网 时间:2024/05/22 04:26
4.14
public class Solution { /** * @param s A string * @return Whether the string is a valid palindrome */ public static boolean isPalindrome(String s) { if(s == null){ return true;// Write your code here } s = s.toUpperCase(); int height = s.length()-1; int low = 0; while(low < height){ while(low < height && !isRight(s.charAt(low))){ low++; } while(low < height && !isRight(s.charAt(height))){ height--; } if(s.charAt(low) != s.charAt(height)){ return false; } else{ low ++; height --; } } return true; }public static boolean isRight(char s){if(s>=65 && s<=90){return true;}if(s>=48 &&s<=57){return true;}return false;}}
0 0
- 415
- 415
- 415A
- @RequestBody 415
- ocp-415
- 415 Unsupported Media Type
- codeforces problem/415/A
- CodeForces 415B
- http 415 错误
- 415 Unsupported Media Type
- Unsupported Media Type 415
- #415 Valid Palindrome
- #415 Valid Palindrome
- josn 404 405 415
- 415 Unsupported Media Type
- HTTP 415问题
- Leetcode 415 Add Strings
- 415 add strings
- 【转载】androidManifest中配置lau…
- 如何获取html中元素的最终的css属…
- Feign logging
- 【原创+文末改良版本】canvas&nbsp…
- 格式化字符串漏洞利用 四、利用的变体
- 415
- linux基础学习之常用命令和常见错误
- 通过MediaStore获取Audio信…
- Unity 游戏存档 PlayerPrefs类的用法
- android service 无法启动
- android MediaPlayer 播…
- HDU 1677:Nested Dolls
- js 数组_模拟堆栈实现——前进、撤销…
- js删除数组元素、清空数组的方法