Domanda di colloquio di PhysicsX

Hackerrank test. Questions fairly easy but need to work quickly.