Standard Chartered, On-Campus Questions Asked on 31st October, 2022, Set-2 | Super Stack | Turnstile
standard-chartered · Question · Posted Nov 2022
Question 1 Super Stack <problem>186</problem> Implement a stack that accepts the following commands and performs the operations described: • push v. Push integer vonto the top of the stack • pop: Pop the top element from the stack • inc I v. Add v to each of the bottom / elements of the stack After each operation, print the value at the top of the stack. If the stack is empty, print the string 'EMPTY' Example operations =['push 4 ,'push ...
The full answer & interview discussion are available to premium members.
Log in Create a free account