HSBC interview question

Hands on coding