Sort in Ascending order, traverse using two pointers by binary search and store the answer in a mutable array to solve "18. 4Sum"
Sort in Ascending order, traverse using two pointers by binary search and store the answer in a mutable array to solve "18. 4Sum"
扫描线 + 离散化 + 排序哈希集合(升序),求解《850. 矩形面积 II》
扫描线 + 离散化 + 排序哈希集合(升序),求解《850. 矩形面积 II》
用排序,快速选择 2 种算法分割数组或列表,传递回调函数,求解《1619. 删除某些元素后的数组均值》
用排序,快速选择 2 种算法,用 slice / array_slice / Arrays.copyOfRange / ToList().GetRange / memcpy / 新建 vector 指定指针分割列表,传递回调函数,求解《1619. 删除某些元素后的数组均值》
顺序遍历 + 二分查找算法,升序 或 降序 排序,5 解法求解《1608. 特殊数组的特征值》
顺序遍历 + 二分查找算法,升序 或 降序 排序,lower_bound / bisect_left / sort.Search 枚举 x,5 解法求解《1608. 特殊数组的特征值》
差分数组(TreeMap / redblacktree.NewWithIntComparator 红黑树)、顺序遍历、二分查找(upper_bound + bisect_right / lower_bound + bisect_left / sort.Search + sort.SearchInts) 3 种算法,用升序(sort / Arrays.sort / Array.Sort / qsort(int*, int, sizeof(int), cmp) / sort.Ints)技巧,求解《1450. 在既定时间做作业的学生人数》
差分数组(TreeMap / Object.create(null) / Array / redblacktree.NewWithIntComparator 红黑树)、顺序遍历、二分查找(upper_bound + bisect_right + sort.Search + sort.SearchInts / lower_bound + bisect_left + sort.Search + sort.SearchInts) 3 种算法,用升……