Q13Comprehension2 Marks22 Dec 2024
Passage
Consider the python code below and answer the given subquestions.
```
def some_algo(arr, target):
left, right = 0, len(arr) - 1
while left < right:
value = arr[left] + arr[right]
if value == target:
return arr[left], arr[right]
elif value < target:
left += 1
else:
right -= 1
return None
```
What will be the return value when invoking some_algo([1, 2, 3, 4, 5], 8)?