Implement Maximum consecutive subsequence algorithm.