Nitrogen Wealth interview question

A code challenge through CodePen