Vai al contenuto principale
โšก
โ† Corsiโ€บInterview PrepModulo 1 ยท Big-O e modelli faciliโ€บDue puntatori: somma delle coppiewrite2 / 104
+75 XP
Compito๐ŸŒ shown in EN
๐Ÿ“ **Task:** Write `pair_sum_sorted(arr, target)` that returns `[i, j]` (indices) of the first pair in the sorted list `arr` that sums to `target`, or `[]` if no such pair exists. Then test with `pair_sum_sorted([1, 2, 4, 7, 11], 9)` and print the result. ๐Ÿ“‹ Implement the function above. Test cases run automatically. ๐Ÿ’ก **Hint:** Re-read the theory if you get stuck โ€” the pattern is right there.
โœ๏ธ Scrivi il tuo codice qui
๐Ÿ
Caricamento Python...
Download una tantum (~1 MB). Poi รจ istantaneo.
๐Ÿ“Š Risultato
Premi Esegui per vedere il risultato...