Missing vertex among N axis | Python3 program for the above approach ; Driver code ; Number of rectangles ; Stores the coordinates ; Insert the coordinates
from collections import defaultdict NEW_LINE def MissingPoint ( V , N ) : NEW_LINE INDENT mp = defaultdict ( lambda : 0 ) NEW_LINE for i in range ( len ( V ) ) : NEW_LINE INDENT mp [ V [ i ] [ 0 ] ] += 1 NEW_LINE DEDENT for it in mp . keys ( ) : NEW_LINE INDENT if ( mp [ it ] % 2 == 1 ) : NEW_LINE INDENT x = it NEW_LINE break NEW_LINE DEDENT DEDENT del mp NEW_LINE mp = defaultdict ( lambda : 0 ) NEW_LINE for i in range ( len ( V ) ) : NEW_LINE INDENT mp [ V [ i ] [ 1 ] ] += 1 NEW_LINE DEDENT for it in mp . keys ( ) : NEW_LINE INDENT if ( mp [ it ] % 2 == 1 ) : NEW_LINE INDENT y = it NEW_LINE break NEW_LINE DEDENT DEDENT print ( x , y ) NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT N = 2 NEW_LINE V = [ ] NEW_LINE V . append ( [ 1 , 1 ] ) NEW_LINE V . append ( [ 1 , 2 ] ) NEW_LINE V . append ( [ 4 , 6 ] ) NEW_LINE V . append ( [ 2 , 1 ] ) NEW_LINE V . append ( [ 9 , 6 ] ) NEW_LINE V . append ( [ 9 , 3 ] ) NEW_LINE V . append ( [ 4 , 3 ] ) NEW_LINE MissingPoint ( V , N ) NEW_LINE DEDENT