Pergunta de entrevista da empresa LINE

Using javascript search max profit by the problem input