I read this question about how to use bisect on a list of tuples and only compare the first value of tuple. It works, but how can I compare two value? if index of x < index of y and y[0] <= x[0] or y[1] <= x[1], bisect.bisect_left return index like
input:[(2, 2), (3, 1), (5, 6)]
bisect.bisect_left(input, (2, 3)) => 0
bisect.bisect_left(input, (3, 4)) => 1
bisect.bisect_left(input, (5, 5)) => 2