摘要: 1 public static int lengthOfLongestSubstring(String s) { 2 if(s.length()<=1){ 3 return s.length(); 4 } 5 HashMap<Character,Integer> map =new HashMap<> 阅读全文
posted @ 2018-11-19 23:21 绸缪 阅读(121) 评论(0) 推荐(0)
摘要: public int[] twoSum1(int[] nums, int target) { int first; int second; int a; int b=1; //外循环 假设第一个值为索引为a out: for (a = 0; a < nums.length; a++) { first 阅读全文
posted @ 2018-11-18 22:14 绸缪 阅读(110) 评论(0) 推荐(0)
摘要: 1 public ListNode myMethod(ListNode l1, ListNode l2){ 2 // 代表位数 3 int e=10; 4 // 连个单链表所做成的数字 5 int ln1=0; 6 int ln2=0; 7 // 通过循环获得两个单链表所表示的整数 8 while 阅读全文
posted @ 2018-11-17 19:36 绸缪 阅读(197) 评论(0) 推荐(0)
摘要: 1 public static int partitionDisjoint(int[] A) { 2 //创建一个链式集合来充当左数组 3 LinkedList<Integer> list = new LinkedList(); 4 //创建一个判断标记 5 boolean flag = true; 阅读全文
posted @ 2018-11-16 15:50 绸缪 阅读(197) 评论(0) 推荐(0)