Rollout Orderings
mediumA release manager has a set of independent services to deploy, identified by distinct integers. Any deployment order is technically valid, and she wants to enumerate every possible order to feed into a chaos-testing rig.
Given a list services of distinct integers, return all permutations of the list. Order of the permutations themselves doesn't matter.
Example 1
in services = [1, 2, 3]
out [[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]
3 services have 3! = 6 orderings.
Example 2
in services = [7]
out [[7]]
Constraints
- · 1 <= len(services) <= 6
- · -10 <= services[i] <= 10
- · all values are distinct
solution.py● loading python…
test results
Hit ▶ Run to test your code against the visible cases.