摘要:
645. 错误的集合 class Solution { public int[] findErrorNums(int[] nums) { int[] err = new int[2]; int n = nums.length; HashMap<Integer,Integer> map = new H 阅读全文
摘要:
414. 第三大的数 class Solution { public int thirdMax(int[] nums) { int n = nums.length; long first, second, third; first = second = third = Long.MIN_VALUE; 阅读全文
摘要:
485.最大连续 1 的个数 class Solution { public int findMaxConsecutiveOnes(int[] nums) { int maxCount = 0, count = 0; int n = nums.length; for(int i = 0; i < n 阅读全文
摘要:
synchronized(object) 非this对象锁 package ch02.test4; import java.util.ArrayList; import java.util.List; class MyList { private List list = new ArrayList( 阅读全文