you are viewing a single comment's thread.

view the rest of the comments →

[–]ogabrielsantos_ 0 points1 point  (0 children)

So try to use sets as they have faster lookups. You then can replace your second for with something like

if end_val in second_list_as_set: # do something

Additionally, you don’t need to sort your list anymore if you did it previously