Aller au contenu principal
⚡
← Cours›Interview PrepModule 1 · Modèles Big-O et faciles›Deux pointeurs : somme de paireswrite2 / 104
+75 XP
Tâche🌐 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.
✏️ Écris ton code ici
🐍
Chargement de Python...
Téléchargement unique (~1 Mo). Ensuite, c’est instantané.
📊 Résultat
Cliquez sur Exécuter pour voir le résultat...