HSBC Interview Question

asked to solve a puzzle. Solved it.