上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页
摘要: 1st bit: 0->1->1->0->0->1->1->0 2nd bit: 0->0->1->1->1->1->0->0 3rd bit: 0->0->0->0->1->1->1->1 阅读全文
posted @ 2017-09-28 12:09 Weiyu Wang 阅读(140) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean isScramble(String s1, String s2) { if(s1.length()==0||s1.equals(s2)) return true; int[] cnt=new int[128]; for(int i=0;i<s1.leng... 阅读全文
posted @ 2017-09-28 06:56 Weiyu Wang 阅读(105) 评论(0) 推荐(0) 编辑
摘要: class Solution { public ListNode partition(ListNode head, int x) { ListNode l1=new ListNode(0); ListNode l2=new ListNode(0); ListNode pre=new ListNode(0); pre.next... 阅读全文
posted @ 2017-09-28 06:32 Weiyu Wang 阅读(98) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int maximalRectangle(char[][] matrix) { if(matrix.length==0||matrix[0].length==0) return 0; int[] heights=new int[matrix[0].length]; in... 阅读全文
posted @ 2017-09-28 06:24 Weiyu Wang 阅读(124) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int largestRectangleArea(int[] heights) { Stack stack=new Stack(); int maxArea=0; for(int i=0;i<=heights.length;i++) { int h=i<... 阅读全文
posted @ 2017-09-28 01:51 Weiyu Wang 阅读(100) 评论(0) 推荐(0) 编辑
摘要: class Solution { public ListNode deleteDuplicates(ListNode head) { ListNode pre=new ListNode(0); pre.next=head; ListNode p=pre; while(p!=null&&p.next!=null) ... 阅读全文
posted @ 2017-09-27 11:20 Weiyu Wang 阅读(98) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean search(int[] nums, int target) { if(nums.length==0) return false; int lo=0; int hi=nums.length-1; while(lonums[hi]) ... 阅读全文
posted @ 2017-09-27 11:10 Weiyu Wang 阅读(120) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int removeDuplicates(int[] nums) { if(nums.length nums[i-2]) nums[i++] = n; return i; } 阅读全文
posted @ 2017-09-27 05:30 Weiyu Wang 阅读(103) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean exist(char[][] board, String word) { if(board.length==0||board[0].length==0) return false; boolean[][] used=new boolean[board.length][b... 阅读全文
posted @ 2017-09-27 05:12 Weiyu Wang 阅读(146) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List> subsets(int[] nums) { List> res=new ArrayList>(); subsets(0, new ArrayList(), res, nums); return res; } private void subsets(int idx,... 阅读全文
posted @ 2017-09-27 05:02 Weiyu Wang 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页