Company: McKinsey_28sept
Difficulty: medium
Equalize It Problem Description Given the following: A non-negative even integer N . An array Arr of N non-negative long integers. You can apply the below operation any number of times: Choose a number from the array and increase or decrease it by 1. The number should be non-negative after applying the operation. Calculate the minimum number of operations you need to perform such that exactly N/2 numbers of the array are the numbers that are squares of a number and exactly N/2 numbers of the array are the numbers that are not a square of a number. Note: 0-based indexing is followed. Function description Complete the function equalizeIt provided in the editor. This function takes the following 2 parameters and returns the required answer: N : Represents the length of the array Arr Arr : Represents the array long long equalizeIt (int N, vector<long long> Arr) { // Write your code here return 0; } Examples Example 1: Input: 6 2 5 6 7 8 9 Output: 2 Explanation: Given N = 6 and Arr =