Given list of processes where each value representing memory consuption by the process and given one variable m representing number of processes to be removed. We need to delete m number of processes from the list in contiguous manner and return minimum amount of main memory used by all the proccesses running after deleting contiguous segment of processes.
Example - processes = {10,4,8,13,20}, m = 2;
output = 22 [removing 13 and 20 as its consuming large memory]
Problem 2:
Given list of movies, and a variable k representing maximum allowed difference, we need to group the movies into groups. No groups can have movies which has difference amongst them greater than m. We need to return minimum number of groups which follows the condition.
Example - movies = [1,5,4,6,8,9,2], k=3;
output = 3 [groups-(1,2,4),(5,6,8),(9)]