G - Palindrome and Permutation
CodeChefOpen on judge ↗
Suppose you have an array $b$ of length $m$. Your goal is to make $b$ a palindrome. The array $b$ of length $m$ is said to be a palindrome if $b_i = b_{m+1-i}$ for every $1 \le i \le m$. To achieve this, you will choose a permutation $p$ of $\{1, 2, \dots, m\}$ and perform the following process using it: - In the $i$-th step ($1 \le i \le m$), you must choose **exactly one** index $j$ ($1 \le j
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