Pergunta de entrevista da empresa Simpl

Given a problem and was asked to share approach and solution.