shadow53

joined 2 years ago
[–] shadow53@programming.dev 1 points 1 day ago (1 children)

Algorithmically, I think you'd want to use a binary search algorithm to find the index of the threshold value, or the index of where it should be. Since the value at that index is either the threshold or the first value greater than the threshold, you can check the value at that index and, if not equal to the threshold, subtract one from the index. Then it's a matter of making a subslice of the list of values starting at that index until the end of the list.