Oracle Interview Question

DSA question on backtracking and hashmap