Dato un array ordinato di numeri interi distinti e un valore target, restituisci l'indice se il target viene trovato. Se non, restituisci l'indice in cui sarebbe inserito in ordine.
Esempio 1:
Input: nums = [1,3,5,6], target = 5
Output: 2
Esempio 2:
Input: nums = [1,3,5,6], target = 2
Output: 1
Esempio 3:
Input: nums = [1,3,5,6], target = 7
Output: 4