Chocolate stack

Company: Netradyne_29oct

Difficulty: medium

Problem Statement

Chocolate stack Problem Description A shop keeps its chocolate boxes in a stack, and every box holds a positive number of chocolates. The stack starts out empty. Over the next N minutes exactly one of these two things happens each minute: the box sitting on top of the stack is sold, or a new box arrives from the warehouse and is placed on top of the stack. Minute i is described by C[i]. Report how many chocolates were in each box that was sold, in the order the sales happened. Notes If C[i] = 0, a box is sold in minute i. If C[i] > 0, a box holding C[i] chocolates arrives in minute i. A buyer only ever turns up when the stack is non-empty, so a sale never has to deal with an empty stack. The stack can hold any number of boxes. Function Description Complete the solve() function provided in the editor. The function takes the following 2 parameters and returns the answer. N: the number of minutes C: the description of the N minutes Input Format Note: use this input format if you are te