摘要:
1 public static void printAllSubstring(String[] args) { 2 String s = "asdfs"; 3 for(int i=0; i<s.length(); i++) { 4 for(int j=i; j<s.length(); j++) { 5 ... 阅读全文
摘要:
1 public static int longestCommonSubstring(String s1, String s2) { 2 int len1 = s1.length(); 3 int len2 = s2.length(); 4 int result = 0; 5 int[] index = new i... 阅读全文
摘要:
1 public ListNode addTwoNumbers(ListNode l1, ListNode l2) { 2 ListNode res = new ListNode(0); 3 int num = 0; 4 int carry = 0; 5 ListNode current = res; 6 ... 阅读全文
摘要:
1 //方法一:使用HashMap记录字符的位置,实现滑动窗口 2 public int lengthOfLonggestSubstring(String s) { 3 if(s == null) { 4 throw new IllegalArgumentException(); 5 }else { 6 ... 阅读全文