If x - coordinate matches with other same line
if ( ( p [ j ] [ 0 ] == x1 or p [ j ] [ 0 ] == x2 ) or ( p [ j ] [ 1 ] == y1 or p [ j ] [ 1 ] == y2 ) ) : NEW_LINE INDENT if ( p [ j ] [ 0 ] == x1 ) : NEW_LINE INDENT c1 += 1 NEW_LINE DEDENT if ( p [ j ] [ 0 ] == x2 ) : NEW_LINE INDENT c2 += 1 NEW_LINE DEDENT DEDENT