Find the First Occurrence in Sorted Array
Problem: Given a sorted array with duplicates, find
the FIRST index where target appears.
Key Modification: When
arr[mid] == target, don't stop! Save mid as potential
answer and search LEFT (right = mid - 1).
Why it works: By continuing to search left even after finding a match, we ensure we find the leftmost occurrence.
Time Complexity: O(log n)