Find the Upper Bound (First Element > Target)
Problem: Find the smallest index where
arr[i] > target (strictly greater).
Logic:
β’ If arr[mid] > target: This could be our answer, save it
and search LEFT.
β’ If arr[mid] β€ target: Too small or equal, search RIGHT.
Key Difference from Lower Bound: Uses
> instead of β₯
Time Complexity: O(log n)