
Problem Statement:
You are working on an Amazon Data Center you are required to reduce the amount of main memory consumption by the processes.
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]
Constraints:
1<N<1000000000 //size of the array
1<m<100000 //contigous segment of the array.
1<process[i]<1000000000
Try to figure out the logic on your own.
Detailed Explainations with Code:
https://dsablogtech.blogspot.com/2024/11/amazon-sde-1-online-assessment-question.html