def countSmaller(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
ans = []
bst = []
for num in reversed(nums):
idx = bisect.bisect_left(bst, num)
ans.append(idx)
bisect.insort(bst, num)
return ans[::-1]
count-of-smaller-numbers-after-self.py 文件源码
python
阅读 36
收藏 0
点赞 0
评论 0
评论列表
文章目录