Skip to content

Add HashSet and MinStack solutions Aditya#2675

Open
ADITYABHURAN wants to merge 2 commits into
super30admin:masterfrom
ADITYABHURAN:aditya-solution
Open

Add HashSet and MinStack solutions Aditya#2675
ADITYABHURAN wants to merge 2 commits into
super30admin:masterfrom
ADITYABHURAN:aditya-solution

Conversation

@ADITYABHURAN
Copy link
Copy Markdown

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

Implement Hash Set (design-1.py)

Strengths:

  • Excellent implementation that matches the reference solution's approach
  • Clean, readable code with good variable naming
  • Proper handling of edge cases (bucket 0 needing extra space)
  • Good documentation with time/space complexity comments
  • Correctly implements all three required methods

Areas for Improvement:

  • The hash function names (hash_func1, hash_func2) could be more descriptive (e.g., primaryHash, secondaryHash)
  • Consider adding docstrings to the class and methods for better documentation
  • The comment about "faced error in some syntax" suggests more practice with Python syntax would help

Note: The submission includes a Min Stack solution that wasn't part of the original problem. For future submissions, focus on only the requested problem to avoid confusion.

VERDICT: PASS


Implement Min Stack

Strengths:

  • The two-stack approach is correctly implemented
  • Time complexity is optimal at O(1) for all operations
  • Code is clean, readable, and well-commented
  • The duplicate strategy for min_stack is an efficient space optimization
  • Proper handling of edge cases (using <= in the condition)

Areas for Improvement:

  • The file contains unrelated code (HashSet implementation) that should be separated
  • The class could benefit from type hints for better code documentation
  • Consider adding docstrings to the class and methods for professional documentation

VERDICT: NEEDS_IMPROVEMENT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants