We are given N stacks of variable length. We need to choose M element such that sum is maximum.


3 3

stack a) 1 2 200

stack b) 5 10 7

stack c) 4 6

the answer will be 1+2+200 = 203 .


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.