TEAM OJ
CodeChefOpen on judge ↗
Omjego wants to make his own team. He wants $pro-coders$ only. If you want to be part of his team you have to solve this question.OJ gives you an Array of $N$ elements where N is $even$ & all elements are $pairwise-distinct$. Your task is to find how many permutations can be possible by changing the position of elements in it which $Maximize$ the following sum : |A1 - A2| + |A3-A4|+ .....
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