Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
4,276 views
in Online Assessments by Expert (34,270 points) | 4,276 views

1 Answer

1 like 0 dislike

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)]

 

 

by Expert (34,270 points)
edited by