F5 Interview Question

Some variation of Permutations II from LeetCode