Pergunta de entrevista da empresa Remitly

Two pointer Leetcode hard problem.