← All problemsSign in

Cloning

CodeChefRating 2507Open on judge ↗

Given an array A consisting of N integers, you have to execute Q queries on it. These queries ask you to determine whether the two sub-arrays a to b and c to d, which are of equal length, are similar or not. The two sub-arrays a to b and c to d are said to be similar, if, after being sorted individually and then compared element by element, they have at most one mismatch. The output should be YES

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