> For the complete documentation index, see [llms.txt](https://jaywin.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jaywin.gitbook.io/leetcode/solutions/0356-line-reflection.md).

# 0356. Line Reflection

<https://leetcode.com/problems/line-reflection>

## Description

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(*n*2) ?

**Example 1:**

![](https://assets.leetcode.com/uploads/2020/04/23/356_example_1.PNG)

```
**Input:** points = [[1,1],[-1,1]]
**Output:** true
**Explanation:** We can choose the line x = 0.
```

**Example 2:**

![](https://assets.leetcode.com/uploads/2020/04/23/356_example_2.PNG)

```
**Input:** points = [[1,1],[-1,-1]]
**Output:** false
**Explanation:** We can't choose a line.
```

**Constraints:**

* `n == points.length`
* `1 <= n <= 10^4`
* `-10^8 <= points[i][j] <= 10^8`

## ac

```java
```
