Permutations

Medium · Backtracking · about 15 minutes

Asked at Microsoft, LinkedIn, Amazon, Meta.

The values in nums are all different. List every way of arranging all of them in a row; the arrangements can come in any order.

Related guides