In this assignment we have 3 stacks given and we have to find out maximum possible sum by popping out the elements of the stack
The idea is to compare the sum of each stack, if they are not same, remove the top element of the stack having the maximum sum.
Find the sum of all elements of in individual stacks. If the sum of all three stacks is the same, then this is the maximum sum. Else remove the top element of the stack having the maximum sum among three of stacks. Repeat step 1 and step 2.
We have used STL for ease of implementation
CASE_1:
CASE_2:
CSE 5A-22