Pregunta de entrevista de Amazon

Find Longest subsequent array with maximum sum