Pergunta de entrevista da empresa Capital One

Two coding questions that I did not pass.