Triple-Inversion
题目地址(762.Number Stream to Intervals)
题目描述
Given a list of integers nums, return the number of pairs i < j such that nums[i] > nums[j] * 3.
Constraints
n ≤ 100,000 where n is the length of nums
Example 1
Input
nums = [7, 1, 2]
Output
2
Explanation
We have the pairs (7, 1) and (7, 2)前置知识
暴力法(超时)
思路
代码
二分法
思路
代码
分治法
思路
代码
最后更新于
这有帮助吗?