The solution of two stack is clear for me.
Java
1 | class MinStack { |
Submission Detail
- 18 / 18 test cases passed.
- Runtime: 64 ms
- Your runtime beats 96.51 % of java submissions.
JavaScript
1 | /** |
Submission Detail
- 18 / 18 test cases passed.
- Runtime: 68 ms
- Your runtime beats 100.00 % of javascript submissions.