find_le<E> function
Find rightmost value less than or equal to x
Implementation
E find_le<E>(List<E> a, E x, {Comparator<E>? compare, ToKey<E, Object>? key}) {
// todo unit-test custom compare and key
int i = bisect_right(a, x, compare: compare, key: key);
if (i != 0) {
return a[i - 1];
}
throw ArgumentError('Value not found');
}