Alarm.com interview question

Arrange Coins question. LC #441