python 二分查找bisect_left 使用

返回这个数字在有序序列中的索引

from bisect import bisect_left
sort_list = [1,5,6,9,22,23]
index = bisect_left(alist,22)
  • leetcode209 长度最小的子数组
posted @ 2024-10-18 15:54  莫大师兄  阅读(21)  评论(0)    收藏  举报