Tap here to switch tabs
Problem
Submissions

Problem: Line Reflection

med
30 min
Try to solve the Line Reflection problem.

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

med
30 min
Try to solve the Line Reflection problem.

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