Trio interview question

It was a coding challlange.