Chef and his games
CodeChefOpen on judge ↗
Chef is playing a game with his childhood friend. He gave his friend a list of N numbers named $a_1, a_2 .... a_N$ (Note: All numbers are unique). Adjust the numbers in the following order: $(i)$ swap every alternate number with it's succeeding number (If N is odd, do not swap the last number i.e. $a_N$ ). $(ii)$ add %3 of every number to itself. $(iii)$ swap the ith number and the (N-i-
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