摘要:
My first solution - using ArrayList: class MyCircularDeque { List<Integer> list = new ArrayList<>(); int k ; public MyCircularDeque(int k) { this.k = 阅读全文
摘要:
My first solution: class Solution { public int[] plusOne(int[] digits) { int n = digits.length; int carry = 1; for(int i=n-1;i>=0;i--){ int digit = di 阅读全文
摘要:
Using binary search, time complexity: O(log(x)) class Solution { public int mySqrt(int x) { int l=1, r =x; while(l<r-1){ int mid=l+(r-l)/2; int temp = 阅读全文