假设:所有范围均不重叠,且水平始终是下一个连续范围的上限。方法是过滤掉较低的级别,然后跳过一个以获得正确的数字。
level_buy = 62 thresholds = [1,10,12,16,18,29,34,46,54,63,73,85] selection = [t for t in thresholds if level_buy < t] level = selection[1] if len(selection) > 1 else 85