$L = [1,2,3,4,5,6,7]$ is a list of integers, return the maximum sum of any adjacent pair of integers in L

58 Views Asked by At

Given this specification, what gets returned?

Precondition: L is a list of integers, len(L) > 1.

Postcondition: Return $max_{0<k<len(L)} \{L[k-1]+L[k]\}$. I.e., return the maximum sum of any adjacent pair of integers in L.

Could someone give me an example of this means. If it gives a list of integers say

$[1,2,3,4,5,6,7]$. What gets returned?