Pergunta de entrevista da empresa Amazon

A coding question about finding the greatest subarray.