Amazon interview question

Calculate out a maximum subsequence of the array.