Tag Archives: Dynamic Programming

Find minimum possible size of array with given rules for removing elements

Given an array of numbers and a constant k, minimize size of array with following rules for removing elements. Exactly three elements can be removed at one go. The removed three elements must be adjacent in array, i.e., arr[i], arr[i+1], arr[i+2]. And the second element must be k greater than first and third element must… Read More »