Implement a function that calculates the max consecutive sum on a subsequence of integers. What is the maximum sum one can achieve by summing consecutive numbers on a finite array of positive and negative numbers? One can start and end anywhere, but it is not allowed to skip numbers.
Asked in the coding round stage. Example: nums = [2, -4, 2, -1, 3, -3, 10, -1, -11, -100, 8, -1] produces 11, using indices 2 through 6.
Implement def max_consecutive_sum(nums):. Return the maximum sum of a non-empty consecutive subsequence.
def max_consecutive_sum(nums):