Question: Given the following: A non - negative even integer N An array Arr of N non - negative long integersYou can apply the below operation

Given the following: A non-negative even integer N An array Arr of N non-negative long integersYou can apply the below operation any number of times: Choose a number from the array and increase itor decrease it by 1 The number should be non-negative afterapplying the operationCalculate 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: O-based indexing is followed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!