PayPal·Software Engineer·Technical Phone Screen
- Given a sorted array of distinct integers and a target value, return the index of the target if found. If not found, return the index where it would be inserted to keep the array sorted. Your solution must run in O(log n) time.
“Classic binary search but with a small twist at the end.”