My implementation of the Facebook example interview test problem