Find final Array after subtracting maximum from all elements K times
Given an array arr[] of N integers and an integer K, the task is to do the below operations with this array K times. Operations are as follows: Find the maximum element (say M) from the array.Now replace every element with M-arri. where 1 ⤠i ⤠N. Examples: Input: N = 6, K = 3, arr[] = {5, 38, 4, 96