Available question text
Given a black-box API hasShips(topRight, bottomLeft) that returns whether at least one ship (point at integer coordinates) lies inside an axis-aligned rectangle, compute the exact number of ships in a target rectangle by recursively subdividing the region (quadtree/divide-and-conquer), pruning empty subrectangles and stopping when a region reduces to a single point.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Bloomberg
Leetcode 1274. Number of Ships in a Rectangle
Reported Sep 30, 2026 · 1 source report
JUNIOR
Source snapshot: Nov 12, 2026
View source