Pergunta de entrevista da empresa OOCL

How would I solve a given problem