Skip to content

Completed Design 1 Homework#2674

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

Completed Design 1 Homework#2674
RitikaC1 wants to merge 2 commits into
super30admin:masterfrom
RitikaC1:master

Conversation

@RitikaC1
Copy link
Copy Markdown

@RitikaC1 RitikaC1 commented Jun 3, 2026

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

Implement Hash Set (design-1.py)

Strengths:

  • Clean, well-documented code with clear comments explaining the approach
  • Correct handling of the edge case for bucket 0 (needs secondaryBucket+1 slots)
  • Proper null-checking before accessing nested structures
  • Good use of descriptive variable names (hashfunc1, hashfunc2, etc.)

Areas for Improvement:

  • The space complexity explanation in comments is confusing. It should simply state O(n) where n is the number of keys, or O(1) per operation for amortized space.
  • Consider using more Pythonic variable names (e.g., self.primary_bucket instead of camelCase)

VERDICT: PASS


Implement Min Stack

  1. Wrong Problem: The student solved "Design HashSet" (LeetCode 705) instead of "Min Stack" (LeetCode 155). This is a fundamental mismatch.

  2. Missing Required Functionality: The solution doesn't implement any of the required MinStack methods:

    • push(int val) - not implemented
    • pop() - not implemented
    • top() - not implemented
    • getMin() - not implemented
  3. Correctness: The solution is incorrect for the given problem as it solves a different problem entirely.

  4. Time/Space Complexity: The analysis is for the wrong problem (HashSet operations), not the MinStack problem.

  5. Recommendation: The student needs to:

    • Re-read the problem statement carefully
    • Implement a stack-based solution with two stacks (main stack + min stack)
    • Ensure all four required methods are implemented
    • Provide accurate complexity analysis for the MinStack operations

VERDICT: NEEDS_IMPROVEMENT

@RitikaC1
Copy link
Copy Markdown
Author

RitikaC1 commented Jun 4, 2026

Accidently did not submit the 2nd question

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