Pregunta de entrevista de Agoda

I have Algorithms to solve