Ctrl K
Problem

All Orderings

Medium · All Orderings

You get an array `values` of distinct integers. Return every way to line these numbers up, that is, every permutation of them. Each permutation is a list that contains every number from `values` exactly once, and no permutation may appear twice. The permutations may be listed in any order.…

Solve the problem →