0356. Line Reflection
Last updated
Last updated
https://leetcode.com/problems/line-reflection
Given n points on a 2D plane, find if there is such a line parallel to y-axis that reflect the given points symmetrically, in other words, answer whether or not if there exists a line that after reflecting all points over the given line the set of the original points is the same that the reflected ones.
Note that there can be repeated points.
Follow up: Could you do better than O(n2) ?
Example 1:
Example 2:
Constraints:
n == points.length
1 <= n <= 10^4
-10^8 <= points[i][j] <= 10^8