Sobes.tech
Junior — Senior

Determining the presence of a vertical axis of symmetry for a set of points

livecode

Task condition

Given a list of points with integer coordinates (x, y). It is necessary to determine whether there exists a vertical line that divides all points not on this line into two groups, which are mirror images of each other with respect to this line. The groups are considered mirror images if each point from the original list has a corresponding pair in the other group.

def is_symmetrical(pts: list[tuple[int, int]]) -> bool:
    ...