Good Permutations
You are given two arrays $A$ and $B$, each of size $N$. Let $P$ denote a permutation length $N$. The permutation $P$ is said to be *good*, if you can make an array $C$ where: - $C_i = A_i + B_{P_i}$ **or** $C_i = A_i - B_{P_i}$, for all $(1\le i \le N)$; - All elements of $C$ are **equal**. Out of the $N!$ possible permutations, find the count of *good* permutations. Since the count can be hu
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