Angad Sandhu
Search
Browse

2013_Detect_Squares

Source name
2013_Detect_Squares.py
# File: Leetcode/Solutions/2013_Detect_Squares.py

"""
Problem Number: 2013
Problem Name: Detect Squares
Difficulty: Medium
Tags: Hash Table, Design, Geometry, Neetcode 150
Company (Frequency): Amazon, Google, Facebook, Microsoft, Apple
Leetcode Link: <https://leetcode.com/problems/detect-squares/description/>

DESCRIPTION

Design a data structure to add points and count how many axis-aligned squares with given query point exist.
Approaches:

* Use hashmap by x coordinate mapping to counts of y; iterate candidate ys to compute potential squares.
"""

Browse the library