Challenge: Min Stack
Learn how to find the minimum element in a stack.
We'll cover the following
Problem
Write code that returns the minimum value in a stack in . In other words, implement the MinStack
ADT.
Input
An integer array from which a MinStack
ADT is to be created.
Output
Returns minimum number in time.
Sample input
array = {9, 3, 1, 4, 2, 5}
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.