Tap here to switch tabs
Problem
Submissions

Problem: Line Reflection

Line Reflection gives a set of points on a two-dimensional plane and asks whether a vertical line exists so every point's mirror image is also in the set.

Statement

Given an array points representing coordinates on a two dimensional plane, determine if there exists a line parallel to the yy axis such that every point reflects across the line to another point in the original set.

Constraints:

  • n == points.length

  • 1≤1 \leq n ≤104\leq 10^4

  • −108≤-10^8 \leq points[i][j] ≤108\leq 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Line Reflection

Line Reflection gives a set of points on a two-dimensional plane and asks whether a vertical line exists so every point's mirror image is also in the set.

Statement

Given an array points representing coordinates on a two dimensional plane, determine if there exists a line parallel to the yy axis such that every point reflects across the line to another point in the original set.

Constraints:

  • n == points.length

  • 1≤1 \leq n ≤104\leq 10^4

  • −108≤-10^8 \leq points[i][j] ≤108\leq 10^8