-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Bug Report for https://neetcode.io/problems/construct-quad-tree
Description:
The problem statement indicates that when a grid region contains mixed values, the corresponding internal node may use either 0 or 1 for its val field. In other words, the value is not meant to be meaningful for non-leaf nodes.
However, NeetCode’s validator only accepts solutions where internal nodes are explicitly assigned a value of 0. If the internal node’s value is set to 1, even though this is allowed by the problem description, the solution is marked incorrect.
On LeetCode, the same solution is accepted because their internal evaluation normalizes non-leaf nodes by implicitly converting their values to 0, making both 0 and 1 acceptable inputs.
Issue:
NeetCode’s validator imposes a stricter requirement than the original problem, rejecting valid solutions that assign 1 to internal nodes.
Steps to Reproduce:
- Implement the quad-tree solution with internal nodes assigned 1 instead of 0.
- Submit the solution on NeetCode.
- Observe that the validator marks the solution incorrect.
- Submit the same solution to LeetCode and note that it is accepted.
