摘要:
二分查找目标数字的右边界+1的index以及比目标数字少1的数字的右边界+1,两者相减即为数字的个数 public class Solution { public int search(int[] nums, int target) { return find(nums, target) - fin 阅读全文
摘要:
public class Solution { public int reversePairs(int[] nums) { if (nums.length < 2) { return 0; } int[] temp = new int[nums.length]; return mergeSort(n 阅读全文