← All problemsSign in

Perfect Array

One day Varun's teacher gave him an assignment. He has an array of numbers , his teacher asked him to make it a Perfect array. Perfect array is an array which consists of every numbers present in any permutation of 1 to $N$(size of array). He can perform following operation any number of times: - pick any number from an array and replace it with any number in the range of 1 to $N$(inclusiv

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start