Dec-01-2020, 07:53 PM
Change it from bisect_left to bisect_right. Now it will give you an insertion point to the right of your target. If you back up one spot (like the program does), that will return the largest number less than or equal to your target.