This question has already been answered:
- Generating all character locations of string 1 response
For example, there is an array var mas = int[1,2,3,4,5,...,n] . The number of options for the location of elements will be n! . How to get all possible options?