Pregunta de entrevista de Okta

Leetcode medium question involved backtracking