Amazon interview question

Find Longest subsequent array with maximum sum