Maximum array elements that can be removed along with its adjacent values to empty given array
Given an array arr[] of size N. In each operation, pick an array element X and remove all array elements in the range [X - 1, X + 1]. The task is to find the maximum number of steps required such that no coins left in the array. Examples: Input: coins [] = {5, 1, 3, 2, 6, 7, 4} Output: 4 Explanation