掘金 后端 ( ) • 2021-09-20 17:49
在升序 tails 中可以用二分查找,尽快找到当前遍历的 num 需要存放的位置,二分范围 $[0,,res]$。
for (int num : nums) {。
int mid = l + ((r - l) &gt ... 阅读全文