Skip to content
Junior–Senior164 views

MinStack: stack with support for the minimum element in O(1)

Task condition

It is necessary to create a data structure - a stack, all its methods should operate in constant time.

class MinStack {
    pop() {
    }

    push(value) {
    }

    getMin() {
    }
}
Frontend tasks in the code trainer