Pergunta de entrevista da empresa Optiver

there were two hackkerrank coding questions.