Count Axis-Aligned Squares Formed by Intersecting Vertical and Horizontal Segments

Problem

You are given a set of vertical line segments and a set of horizontal line segments. Each segment is represented by two endpoints, and each point is represented as (x, y).

Retur...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: