## Adjacency Hatred codechef solution – An array is called lovely if the sum of absolute differences of each adjacent pair of elements is odd; formally, the array SS of size mm is lovely if ∑m−1i=1∑i=1m−1 |Si−Si+1||Si−Si+1| is odd.

An array is called lovely if the sum of absolute differences of each adjacent pair of elements is odd; formally, the array SS of size mm is lovely if ∑m−1i=1∑i=1m−1 |Si−Si+1||Si−Si+1| is odd. You are given an array AA of NN integers. You need to reorder the array in any manner such that the array becomes lovely. If there is no reordering operation that makes the array lovely, output -1. Input Format The first … Read more