Lumenalta interview question

A fairly straightforward programming assignment.