A program to find the processes which utilize the memory optimally, given the list of the processes with their memory usage and the total memory available.
Example:- Total memory :- 10
First column denotes process id's and 2nd column is the memory consumption of respective process.
1 2 2 3 3 4 4 5
Answer should be processes {1,2,4} with memory consumption {2,3,5} as 2+3+5=10