HSBC Interview Question

One technical coding challenge. It was average