Solve Two Backtracking Array Problems | Meta Interview Question