Onity Group interview question

Solving a puzzle