UST Interview Question

Some basic logic implementation