Pregunta de entrevista de Pinterest

basic backtracking and counting problems.