Permutate in minimum
CodeChefOpen on judge ↗
Given an array A of N positive integers, find the minimum number of operations required to transform array A to array B such that the following condition is satisfied. - Let the largest element in B be Y and the smallest be X. Y (1 + Y) + X(1 - Y) is equal to two times the sum of all elements in B In one operation you can change A[i] to any integer of your choice. ### Input - The first line co
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