practice for Kadane's algorithm to find a maximum contiguous subsequence
in one-dimensional sequence