Stack it up
CodeChefOpen on judge ↗
You will be given M queries. Each query can only be of the following types: 1 y - Push the element y onto the stack. 2 - Pop the element at the top of the stack. 3 - Display the maximum element in the stack. Input The first line contains an integer,M. The consecutive M lines each contain an above-mentioned query. (It is assured no query is invalid.) Output For every type 3 query, displa
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start