Given a sorted array of distinct integers and a target, return the target's index when present.
Otherwise, return the index where the target should be inserted to keep the array sorted.
Inputnums = [1, 3, 5, 6], target = 5
Output2
5 is already the third element. Its zero-based index is 2.
Inputnums = [1, 3, 5, 6], target = 2
Output1
2 belongs between 1 and 3, so its insertion index is 1.
1 ≤ nums.length ≤ 10,000