https://github.com/developerwaleed/mob-programming
https://github.com/developerwaleed/mob-programming
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/developerwaleed/mob-programming
- Owner: developerwaleed
- Created: 2022-06-28T07:28:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-28T07:29:16.000Z (almost 4 years ago)
- Last Synced: 2024-10-02T12:41:16.188Z (over 1 year ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## How to solve this challenge?
1. Read the "Challenge description" below.
2. Make changes to the [challenge.js](./challenge.js) file.
3. Commit your changes.
4. Wait for the result of the "GitHub Classroom Workflow" action. If it is green - congratulations, you solved this challenge! If not - try again!
5. *You can watch an example of how to solve a challenge in the video linked in the theoretical lesson preceding this challenge.*
## Challenge description
### Min Stack
Create a Stack that contains the standard push and pop methods. It should also contain another method min that returns the minimum number in the Stack.
#### Extra Credit
All operations should take O(1) time.
#### Example
This is an example of a test case:
```
const stack = new Stack()
stack.push(3)
stack.push(5)
console.log(stack.min())
// => 3
stack.pop
stack.push(7)
console.log(stack.min())
// => 3
stack.push(2)
console.log(stack.min())
// => 2
stack.pop
console.log(stack.min())
// => 3
```
Get stuck and need some hint?
Check below link:
*https://gitlab.com/microverse/guides/coding_challenges/hints/blob/master/challenges/basic-data-structures/min-stack.md*
### Troubleshooting
If you cannot see any auto-grading workflows on the [Actions](../../actions) page, learn how to fix it in [this repo](https://github.com/microverse-students/autograding-troubles-js/blob/main/README.md).