Skip to content
Advertisement

I need to python code to get sum of some of its k consecutive numbers in a list in python

#Given array of integers, find the sum of some of its k consecutive elements.

#Sample Input: #inputArray = [2, 3, 5, 1, 6] and k = 2

JavaScript

Advertisement

Answer

Your question is not clear but assuming you need a function to return the sum of the highest pair of numbers in your list:

JavaScript
Advertisement