上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: public class Solution { public int[] plusOne(int[] digits) { int carry = 1; int length = digits.length; List list = new ArrayL... 阅读全文
posted @ 2015-12-11 12:02 Weizheng_Love_Coding 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 刚从微软onsite回来,感觉要跪了。不过doesnt matter 继续刷题面谷歌很有意思的一道小题,很容易出错public class Solution { public int compareVersion(String version1, String version2) { ... 阅读全文
posted @ 2015-12-11 11:59 Weizheng_Love_Coding 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 二分搜索,边界条件要注意public class Solution { public List countSmaller(int[] nums) { List sorted = new ArrayList(); int length = nums.length; ... 阅读全文
posted @ 2015-12-07 08:55 Weizheng_Love_Coding 阅读(118) 评论(0) 推荐(0) 编辑
摘要: class TrieNode { // Initialize your data structure here. TrieNode[] child; boolean isWord; public TrieNode() { child = new TrieNode... 阅读全文
posted @ 2015-12-06 12:36 Weizheng_Love_Coding 阅读(125) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public List wordBreak(String s, Set wordDict) { return helper(s, wordDict, new HashMap>()); } public List ... 阅读全文
posted @ 2015-12-06 12:19 Weizheng_Love_Coding 阅读(129) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String longestPalindrome(String s) { int length = s.length(); String result = ""; for (int i = ... 阅读全文
posted @ 2015-12-06 10:22 Weizheng_Love_Coding 阅读(142) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String longestPalindrome(String s) { int length = s.length(); String result = ""; for (int i = ... 阅读全文
posted @ 2015-12-06 09:47 Weizheng_Love_Coding 阅读(117) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String simplifyPath(String path) { String[] strs = path.split("/"); Stack stack = new Stack(); ... 阅读全文
posted @ 2015-12-06 08:05 Weizheng_Love_Coding 阅读(107) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int calculate(String s) { Stack stack = new Stack(); s = s.replace(" ", ""); int length = s.len... 阅读全文
posted @ 2015-12-06 07:35 Weizheng_Love_Coding 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 在网上看了一个超级精妙的解法public class Solution { public String multiply(String num1, String num2) { int length1 = num1.length(); int length2 = n... 阅读全文
posted @ 2015-12-06 06:31 Weizheng_Love_Coding 阅读(141) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页