Skip to content

❗ Test Case Violates Constraints in "Design Add and Search Word" Problem #4411

@ayushsaun24024

Description

@ayushsaun24024

Bug Report for https://neetcode.io/problems/design-word-search-data-structure

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

❗ Bug Report: Test Case Violates Constraints in "Design Add and Search Word" Problem

📝 Description:

There is a contradiction between the problem constraints and the test cases provided for the problem "Design Add and Search Word Data Structure".


🔒 Stated Constraint:

"There will be at most 2 dots in word for search queries."


🧪 Offending Test Case:

["WordDictionary", "addWord", "development", "addWord", "deployment", "search", "d......ent"]
  • The search query "d......ent" contains 6 dots, which clearly violates the constraint that allows at most 2 dots.

🔁 Steps to Reproduce:

  1. Initialize the WordDictionary.
  2. Add words "development" and "deployment".
  3. Perform search with "d......ent".

❗ Expected Behavior:

  • If the constraint is enforced, the test case should not be allowed.
  • If the test case is valid, the constraint must be updated to reflect reality.

✅ Suggested Fix:

  • Option 1: Update the constraint to allow more than 2 dots (e.g., "up to 6 dots").
  • Option 2: Remove or replace test cases that include more than 2 dots.

📎 Additional Info:

Screenshots attached show both:

  • The constraint limiting to 2 dots
  • A test case using 6 dots

Please verify and align the constraints and test suite accordingly.

Here are the screenshots attached

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions