JAPC1001-Editorial

PROBLEM LINK:

Practice

Contest

Author: A Rupeswar Subudhi

Tester: Pritish Priyatosh Nayak

Editorialist: Debanshu Sekhar Jena

DIFFICULTY:

Cakewalk

PREREQUISITES:

Implementation

PROBLEM:

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.

EXPLANATION:

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)

SOLUTIONS:

Setter Solution
Editorialist’s Solution

Submission of solution for this problem is not allowed.

It will be allowed soon. Please wait till then.