Does the original permutation only contain numbers from 1 to N, or can it contain any number?
If it can contain any number, what are its constraints?
Does the original permutation only contain numbers from 1 to N, or can it contain any number?
If it can contain any number, what are its constraints?
Iād say yes, only numbers 1 to N. You can ask in comment on problem statement to be sure