Leetcode Solutions Java Python C++
All contents and pictures on this website come from the Internet and are updated regularly every week. They are for personal study and research only, and should not be used for commercial purposes. Thank you for your cooperation.
Welcome to Subscribe On Youtube:

155. Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

 

Example:

MinStack minStack = new MinStack();
minStack.push(-2);
minStack.push(0);
minStack.push(-3);
minStack.getMin();   --> Returns -3.
minStack.pop();
minStack.top();      --> Returns 0.
minStack.getMin();   --> Returns -2.

 

Difficulty:

Easy

Lock:

Normal

Company:

Adobe Amazon Apple Bloomberg Cisco eBay Flipkart GoDaddy Goldman Sachs Google Intuit LinkedIn Lyft Microsoft Oracle Pure Storage Snapchat Uber Visa Walmart Labs Wish Zenefits

Problem Solution

155-Min-Stack

All Problems:

Link to All Problems
All contents and pictures on this website come from the Internet and are updated regularly every week. They are for personal study and research only, and should not be used for commercial purposes. Thank you for your cooperation.