Turing interview question

A DSA Challenge like backtracking