ans is the number of points of intersection of the line segments with the vertical lines
ans = 0 NEW_LINE for i in range ( m ) : NEW_LINE INDENT x1 = segments [ i ] [ 0 ] NEW_LINE x2 = segments [ i ] [ 2 ] NEW_LINE DEDENT