IXL Learning Interview Question

Some dfs & backtracking problem and analyze complexity.