Noom interview question

Solve an algorithm in CoderPad