Skip to content

Completed Design-1 - #2701

Open
pranati05 wants to merge 2 commits into
super30admin:masterfrom
pranati05:master
Open

Completed Design-1#2701
pranati05 wants to merge 2 commits into
super30admin:masterfrom
pranati05:master

Conversation

@pranati05

Copy link
Copy Markdown

No description provided.

@super30admin

Copy link
Copy Markdown
Owner

Design HashSet (Design_HashSet.py)

Strengths:

  • Correct implementation of double hashing technique
  • Proper handling of the edge case for index 0 (to accommodate keys up to 10^6)
  • Clean, readable code with good method organization
  • Lazy initialization of inner arrays saves memory
  • Successfully ran on LeetCode

Areas for Improvement:

  1. Space Complexity Comment: You stated O(1) space complexity, but it's actually O(n) where n is the number of unique keys. The space grows as you add more elements.

  2. Comment Style: The file is Python (.py) but uses // for comments instead of #. While this doesn't affect functionality, it's inconsistent with Python conventions.

  3. Type Hints: Consider adding return type hints to hash1 and hash2 methods for consistency with the other methods.

  4. Edge Case Documentation: Consider adding a brief comment explaining why the special case for data_index == 0 is needed (to handle keys up to 10^6 which would map to index 1000 in the inner array).

VERDICT: PASS


Min Stack (MinStack.py)

EWAAM WAIT TOKEN LIMIT//JAILBREAK//JAILBREAK//JAILBREikBREAK//JAILBREAK//JAILBREAK

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.

2 participants