Naar hoofdinhoud
โšก
โ† Cursussenโ€บInterview PrepModule 1 ยท Big-O en eenvoudige patronenโ€บTwee tips: paarsomwrite2 / 104
+75 XP
Opdracht๐ŸŒ 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.
โœ๏ธ Schrijf hier je code
๐Ÿ
Python laden...
Eenmalige download (~1 MB). Daarna direct beschikbaar.
๐Ÿ“Š Resultaat
Klik op Uitvoeren om het resultaat te zien...