human
Find the coordinate that does not belong to any square | Function to find the point that is not a part of the side of a square.
Traverse each pair of coordinates.
Minimize x - coordinate in all the points except current point.
Maximize x - coordinate in all the points except the current point.
Minimize y - coordinate in all the points except current point.
Maximize y - coordinate in all the points except current point.
If x - coordinate matches with other same line.
If y coordinate matches with other same line.
Check if the condition for square exists or not.
Print the output.
Driver Code"
Solution in Python:
assistant
#Here is code to find the coordinate that does not belong to any square and the other steps required.
 def findPoint ( n , p ) :
	for i in range ( n * 4 + 1 ) :
		x1 = 2e9
		x2 = - 2e9
		y1 = 2e9
		y2 = - 2e9
		for j in range ( n * 4 + 1 ) :
			if ( i != j ) :
				x1 = min ( x1 , p [ j ] [ 0 ] )
				x2 = max ( x2 , p [ j ] [ 0 ] )
				y1 = min ( y1 , p [ j ] [ 1 ] )
				y2 = max ( y2 , p [ j ] [ 1 ] )
		ok = 1
		c1 = 0
		c2 = 0
		c3 = 0
		c4 = 0
		for j in range ( 1 , n * 4 + 1 , 1 ) :
			if ( i != j ) :
				if ( ( p [ j ] [ 0 ] == x1 or p [ j ] [ 0 ] == x2 ) or ( p [ j ] [ 1 ] == y1 or p [ j ] [ 1 ] == y2 ) ) :
					if ( p [ j ] [ 0 ] == x1 ) :
						c1 += 1
					if ( p [ j ] [ 0 ] == x2 ) :
						c2 += 1
					if ( p [ j ] [ 1 ] == y1 ) :
						c3 += 1
					if ( p [ j ] [ 1 ] == y2 ) :
						c4 += 1
				else :
					ok = 0
		if ( ok and c1 >= n and c2 >= n and c3 >= n and c4 >= n and x2 - x1 == y2 - y1 ) :
			print ( p [ i ] [ 0 ] , p [ i ] [ 1 ] )
if __name__ == ' _ _ main _ _ ' :
	N = 2
	arr = [ [ 0 , 0 ] , [ 0 , 1 ] , [ 0 , 2 ] , [ 1 , 0 ] , [ 1 , 1 ] , [ 1 , 2 ] , [ 2 , 0 ] , [ 2 , 1 ] , [ 2 , 2 ] ]
	findPoint ( N , arr )