Running time not quite stable. Am trying to avoid calculate mean (which might not be int thus probably error-prone). Bit tricky is right part needs to be sorted in different y-order as left side.

```
public boolean isReflected(int[][] points) {
int n = points.length;
if (n <= 1)
return true;
int min = points[0][0];
int max = points[0][0];
for (int i = 1; i < n; i++)
if (points[i][0] < min)
min = points[i][0];
else if (points[i][0] > max)
max = points[i][0];
final int xmax = max;
final int xmin = min;
Arrays.sort(points, new Comparator<int[]>() {
@Override
public int compare(int[] pa, int[] pb) {
if (pa[0] != pb[0])
return pa[0] - pb[0];
return pa[0] - xmin <= xmax - pa[0] ? pa[1] - pb[1] : pb[1] - pa[1]; // reverse for right side
}
});
for (int i = 0, j = n-1; i <= j; i++, j--)
if ((points[i][0] - min != max - points[j][0]) || (points[i][0] * 2 != min + max && points[i][1] != points[j][1]))
return false;
return true;
}
```