Qualtrics Interview Question

Problem involving recursion/backtracking