Goldman Sachs interview question

Hackerrank coding questions, basic math questions