Pergunta de entrevista da empresa Tencent

Give you a unsorted int array. How to get the subset having the max sum