摘要:
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 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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<... 阅读全文