Your question is Find First Matching Event Timestamp. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
In a Google Photos mobile client, event timestamps may arrive unsorted after local batching. Given an integer array timestamps and an integer target, return the index of the first occurrence of target after sorting the array in non-decreasing order. If target does not exist, return -1.
timestamps is a list of integers. target is an integer.target in the sorted version of timestamps, or -1 if not found.def first_sorted_occurrence(timestamps, target):