Goldman Sachs Interview Question

Hackerrank coding questions, basic math questions