Binary search. Truly a classic amongst CS topics. Let say you have a sorted list and you want to find a certain element how do you do it? Well, since its sorted if we select a middle element if the middle element is less than the target youre looking for than you should probably look at things on the right of middle... Seem simple enough right. Feel good ?

you can now solve. https://leetcode.com/problems/binary-search/

As you keep doing problems you realize one thing that most problems

in general use

l,r = 0, n-1
while l <= r: