Add MinStack class with basic stack operations#2644
Add MinStack class with basic stack operations#2644sadabala30 wants to merge 1 commit intosuper30admin:masterfrom
Conversation
Implement MinStack class with push, pop, top, and getMin methods.
Implement Hash Set (minstack.py)It seems there was a mix-up in the problem you were solving. The problem provided was to implement a HashSet without using built-in libraries, but your solution is for a MinStack, which is a different data structure entirely. For the HashSet problem, you need to design a class that supports add, remove, and contains operations. The reference solution uses a double hashing technique with a 2D boolean array to efficiently store and check for keys. To correct this:
Here are some steps to get started:
Since the problem constraints are manageable (keys up to 10^6 and at most 10^4 operations), chaining is also acceptable. However, double hashing can be more space-efficient. Please review the problem statement again and implement the correct solution. If you have any questions about the HashSet implementation, feel free to ask. VERDICT: NEEDS_IMPROVEMENT Implement Min StackYour solution is correct and meets the time and space complexity requirements. Well done! However, there are a few areas for improvement in terms of code quality:
Overall, your solution is solid. Keep up the good work! VERDICT: PASS |
Implement MinStack class with push, pop, top, and getMin methods.