Hello https://codeforces.net/contest/1392/problem/B I dont understand why my code fails? https://ideone.com/OvJGfP
Algo: if k is odd : then -=max from every element. if k is even: then dont do anything because the subtractions will eliminate each other like max-(max-x) = x
Thanks,
$$$k = 2$$$. input array: $$$[-199, 192]$$$
After first iteration, the array becomes: $$$[391, 0]$$$
After second iteration, $$$[0, 391]$$$
Hope you get the point.