30:00
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be inserted.
1≤nums.length≤1041 \leq \text{nums.length} \leq 10^41≤nums.length≤104
−104≤nums[i]≤104-10^4 \leq \text{nums}[i] \leq 10^4−104≤nums[i]≤104
nums contains distinct values sorted in ascending order.
nums
−104≤target≤104-10^4 \leq \text{target} \leq 10^4−104≤target≤104
Binary search
Target: 5