The fastest way to get all permutations of a range without having consecutive neighbours in python
The fastest way to get all permutations of a range without having consecutive neighbours in python Question: I want to get all permutations of any range with length n, starting from 0 and ending on n (range(n)) that don’t have consecutive numbers. Example: [0,1,2,3,4] There the permutations should look like for example [0,2,4,1,3] or [3,1,4,2,0] …