Question: Python - please provide the function for the problem Problem 2 Given a list of integers L, a number A, and an integer k, find

Python - please provide the function for the problem

Problem 2

Given a list of integers L, a number A, and an integer k, find k consecutive numbers in L that add up to A.

Explain or describe your solution in English.

Examples:

Input: L = [10,5,20,8], A = 25, k = 2. Output: [5,20]

Input: L = [10,5,20,8], A = 35, k = 3. Output: [10,5,20]

Input: L = [10,5,20,8], A = 35, k = 2. Output: None

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 Databases Questions!