Question: Task 3 You are given an array A consisting of N integers ( N is divisible by 3 ) and an integer K . In
Task
You are given an array A consisting of N integers N is divisible by and an integer In one move, you can increase or decrease any element of by The task is to modify array A using such moves in order to maximize the difference between the th largest element and the th smallest element of the resulting array. You can perform at most K moves.
For example, array consists of elements, so the Nth that is the nd largest element is and the th nd smallest element is
Write a function:
int solutionvector
Exampre.
Given
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
