Array maximum subsequence and program