Pregunta de entrevista de HSBC

One technical coding challenge. It was average