Amazon Interview Question

Find Longest subsequent array with maximum sum