Enter array of nums: Enter k: Find the maximal sum between any two adjacent elements till kth number.
Find the maximal sum between any two adjacent elements of a given array of integers.