Banxware interview question

Coding challenge related to algorithms.