Skip to content

Conversation

@dharma6
Copy link

@dharma6 dharma6 commented Dec 30, 2025

No description provided.

@super30admin
Copy link
Owner

Strengths:

  • Both implementations are generally well-structured and readable.
  • The MinStack implementation is correct and efficient.
  • Good use of helper methods for hash calculations in MyHashSet.

Areas for Improvement:

  • In MyHashSet, you should handle the edge case where key is 1,000,000 by adding an extra bucket when the primary index is 0 (like in the reference solution).
  • The secondary_buckets size could be 1000 instead of 1001 to match the reference solution's approach.
  • Consider adding docstrings to explain the purpose of each method.
  • The MinStack implementation could initialize min_val to None instead of float('inf') for better clarity.

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.

2 participants