Hoarding programming problems for you!

Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

All posts tagged permutations

Permutations II

Problem statement Given a list, nums, of distinct numbers, return all possible unique permutations. Sample input

Sample output

Solution In another post we showed how this problem can be solved iteratively. We can use the same technique but add a check to skip adding the number n to . . . Read more

Permutations challenge – Iterative solution

Problem statement Given a list, nums, of distinct numbers, return all possible permutations. Sample input

Sample output

Solution In another post we showed how this problem can be solved using a recursive technique by swapping. We stumbled upon a nice iterative solution that we thought might be worth . . . Read more

Permutations challenge

Problem statement Given a list, nums, of distinct numbers, return all possible permutations. Sample input

Sample output

Solution We are using a technique called permutations by swapping. Full code