Make array great again
You are a citizen of Arrayland. Your President (Mr. P) has given you a mundane problem: You're given an array a with size N (1-based indexing). You are allowed to perform an arbitrary number (including zero) of operations of the following type: choose an integer i (1 ≤ i ≤ N) and swap ai with aN-i+1. Your goal is to make the array a great. An array is great if it satisfies one of the following c
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