Pregunta de entrevista de Remitly

Similar to a leetcode hard problem utilizing backtracking.