Question: 6 . This is a coding exercise that Google has used in interviews with a modification . . . Write a function findSum that takes

6. This is a coding exercise that Google has used in interviews with a modification ...
Write a function findSum that takes as its arguments:
- a sorted list of positive integers lst, and
- an integer sum.
findSum searches for two elements lst[i] and lst[j] such that lst[i]+lst[j]== sum and i \(!=j \). If such a pair of elements exists, the function returns the tuple (\( i, j \)); otherwise it returns None.
So, for example,
findSum([1,2,3,9],8) is None
while
findSum([1,2,4,4],8) is (2,3)
Do this using recursion. Write code to test your function. [2.75 hour challenge]
6 . This is a coding exercise that Google has

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!