Question: 6 . This is a coding exercise that Google has used in interviews with a modification . . . Write a function findSum that takes
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 lsti and lstj such that lstilstj 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 is None
while
findSum is
Do this using recursion. Write code to test your function. hour challenge
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
