上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页
摘要: public class Solution { public int removeElement(int[] nums, int val) { if (nums.length == 0) { return 0; } int lef... 阅读全文
posted @ 2015-12-03 03:04 Weizheng_Love_Coding 阅读(120) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String convert(String s, int numRows) { if (numRows == 1) { return s; } int flg = 0;... 阅读全文
posted @ 2015-12-03 02:09 Weizheng_Love_Coding 阅读(119) 评论(0) 推荐(0) 编辑
摘要: public class LRUCache { HashMap map = new HashMap(); ListNode start; ListNode end; int capacity; int cur_size; public LRUCache(int c... 阅读全文
posted @ 2015-12-03 01:59 Weizheng_Love_Coding 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 第一个是用了hashmap, 第二个是在每个结点后面加一个新的结点public class Solution { public RandomListNode copyRandomList(RandomListNode head) { if (head == null) { ... 阅读全文
posted @ 2015-12-02 15:47 Weizheng_Love_Coding 阅读(134) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public List getSkyline(int[][] buildings) { List height = new ArrayList(); List result = new ArrayList(); ... 阅读全文
posted @ 2015-12-02 15:37 Weizheng_Love_Coding 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 单纯的dfs,感觉应该有更好的办法public class Solution { public void solveSudoku(char[][] board) { helper(board); } public boolean helper(char[][] boa... 阅读全文
posted @ 2015-12-02 14:26 Weizheng_Love_Coding 阅读(139) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public void connect(TreeLinkNode root) { if (root == null) { return; } TreeLinkNode pre = r... 阅读全文
posted @ 2015-12-02 11:58 Weizheng_Love_Coding 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 之前写了个很复杂的办法,后来参考网上思路,觉得这个是最简便的写法了public class Solution { public String numberToWords(int num) { String[] first = "Zero One Two Three Four Fi... 阅读全文
posted @ 2015-12-02 11:42 Weizheng_Love_Coding 阅读(146) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public void rotate(int[] nums, int k) { int length = nums.length; k = k % length; reverse(nums, 0, len... 阅读全文
posted @ 2015-12-02 08:26 Weizheng_Love_Coding 阅读(120) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public List spiralOrder(int[][] matrix) { List result = new ArrayList(); int row = matrix.length; if (... 阅读全文
posted @ 2015-12-02 08:17 Weizheng_Love_Coding 阅读(113) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页