摘要:首先看一下只需要return 长度的解法: public class Solution { public int lengthOfLongestSubstring(String s) { /*** * Basic idea: N(o^2): for each character, continue
阅读全文
摘要:/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solu
阅读全文
摘要:public class Solution { public int[] twoSum(int[] nums, int target) { /* Basic idea: Load the array into a hashMap with the value of each array elemen
阅读全文
摘要:public class Solution { /** * @param s: The first string * @param b: The second string * @return true or false */ public boolean...
阅读全文
摘要:/** * Definition for ListNode. * public class ListNode { * int val; * ListNode next; * ListNode(int val) { * this.val = val; * this.next = null; * } *
阅读全文
摘要:class Solution { /** * @return: The same instance of this class every time */ //http://www.cnblogs.com/EdwardLiu/p/4443230.html ...
阅读全文