![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
string
文章平均质量分 82
jizhi_de_wo
这个作者很懒,什么都没留下…
展开
-
ZigZag Conversion
public class Solution { public String convert(String s, int nRows) { int len = s.length();//len即为字符串长度 if(len<=nRows||nRows<=1) return s; //such condition can't form the zigzag rou转载 2015-02-04 23:46:43 · 302 阅读 · 0 评论 -
Valid Palindrome
//palindrome回文//我们只能考虑alphanumeric (字母与数字)。所以必须要找一个判别字母和数字的方法。int value=Integer.valueOf("1");//49//所以我的想法用数组,存下有效的ASCII,做做比较////还需注意ignoring cases.public class Solution { public boolean isPal原创 2015-02-06 01:06:24 · 266 阅读 · 0 评论 -
LeetCode Path Sum
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */public class Solution { publi原创 2015-02-11 09:44:28 · 258 阅读 · 0 评论 -
Roman to Integer
public class Solution { public int romanToInt(String s) { int answer = 0; int i = 0; int len = s.length(); while(i < len) { int x=0;原创 2015-02-13 05:31:28 · 240 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
import java.util.Hashtable;//漏写public class Solution { public int lengthOfLongestSubstring(String s) { Hashtable checkrepeatation = new Hashtable(); int i=1, j=0, currlength=1, lo原创 2015-03-03 00:57:14 · 255 阅读 · 0 评论 -
Java String类知识总结并结合leetcode
字符串类型的转换/* You convert primitive types to a string with toString033 * String byteString = Byte.toString(bigByte);034 * String shortString = Short.toString(bigByte);035转载 2015-03-21 08:47:19 · 618 阅读 · 0 评论