Trio Interview Question

It was a coding challlange.