Pergunta de entrevista da empresa JPMorganChase

2 Programming Tasks, somewhat difficult