Count the Count
CodeChefOpen on judge ↗
You are given an array $A$ consisting of $N$ integers such that the value at the index is the index itself.($1$ based indexing) Now, Ayush wonders how many such arrays can be created by shuffling the elements of the original array $A$, such that the absolute difference of the value at that index and that index is atmost 1. More formally, Ayush wishes to find the count of arrays formed afte
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.
Sign in to chat with the tutor and save your progress.
Sign in to start