Mambu Interview Question

A coding problem from Hackerrank.