Loading problem...
You are given a table of 2D integer coordinates:
Table: Coordinates
Rows may repeat, and duplicate coordinates are allowed.
A coordinate pair (x1, y1) has a reflection partner when another row (x2, y2) exists such that:
Your task is to return all unique coordinate pairs (x, y) that satisfy one of the following:
Output requirements:
Supported submission environments:
Coordinates:
| X | Y |
|----|----|
| 20 | 20 |
| 20 | 20 |
| 20 | 21 |
| 21 | 20 |
| 23 | 22 |
| 22 | 23 |[
{"x":20,"y":20},
{"x":20,"y":21},
{"x":22,"y":23}
](20,20) is included because it appears at least twice. (20,21) and (21,20) form a reflected pair, so only the canonical row with x < y is kept. Likewise, (22,23) is kept from the pair (23,22) and (22,23).
Coordinates:
| X | Y |
|---|---|
| 5 | 5 |
| 4 | 7 |
| 9 | 1 |[](5,5) appears only once, so it does not qualify. Neither (4,7) nor (9,1) has a reverse partner.
Coordinates:
| X | Y |
|----|----|
| -3 | 8 |
| 8 | -3 |
| 0 | 0 |
| 0 | 0 |
| 10 | 1 |
| 10 | 1 |[
{"x":-3,"y":8},
{"x":0,"y":0}
]Negative values are valid. The pair (-3,8) has reverse (8,-3), and (0,0) appears twice. Duplicates of (10,1) do not help because (1,10) is missing.
Constraints