Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2013. Detect Squares
Design a data structure that supports adding points (duplicates allowed) and, for a given query point, counts how many triples of stored points together with the query form an axis-aligned square. The challenge is to efficiently enumerate and combine compatible partner points per query (coords 0–1000, ≤3000 total operations) rather than brute-forcing all triples.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.