Pergunta de entrevista da empresa Flexton

Standard backtracking Leet Code question