HSBC interview question

asked to solve a puzzle. Solved it.