摘要: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode rem... 阅读全文
posted @ 2016-08-09 23:36 阿怪123 阅读(130) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int lengthOfLongestSubstring(String s) { int size=s.length(); int[] map=new int[206]; int maxLen=0; for(int i=0;imaxLen) ... 阅读全文
posted @ 2016-08-09 22:32 阿怪123 阅读(90) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String longestCommonPrefix(String[] strs) { int size=strs.length; if(size==0) return ""; int index=0; boolean flag=true;... 阅读全文
posted @ 2016-08-09 19:10 阿怪123 阅读(119) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode add... 阅读全文
posted @ 2016-08-09 18:55 阿怪123 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 这道题的关键点在于,对于字符串的赋值操作要谨慎,尽量采用记录下标的方式,而不是整个字符串的赋值,这样可以节省时间。 阅读全文
posted @ 2016-08-09 18:19 阿怪123 阅读(115) 评论(0) 推荐(0) 编辑