Author: A Rupeswar Subudhi
Tester: Pritish Priyatosh Nayak
Editorialist: Debanshu Sekhar Jena
Arrange the integers from 1-n such that all the values occur exactly once and the value at any index is not equal to the value of the index.
One of the possible solution is this:-
First print all the integers from 2-N and then print 1 at last.
For the input N=5 given in sample testcase, we can arrange it like this:-
2, 3, 4, 5, 1
Time Complexity : O(N)