this is going to be a quick tutorial on binary search.
binary search is basically searching a number in O(logn).idk why someone make an algorithm just for searching a number lmao. for easy problems u can use lower_bound and upper_bound or just use binary search function so ez.harder problems require u to make some modifications on binary search so be sure to save the code in ur template so u can beat those cocky gm that tells u to google everything in solving speed.
binary search is kinda useless in higher leagues since nowadays its all about mathforces.