-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
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:
- Initialize the WordDictionary.
- Add words
"development"
and"deployment"
. - 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


Metadata
Metadata
Assignees
Labels
No labels