human
Largest square which can be formed using given rectangular blocks | Function to find maximum side length of square.
Sort array in asc order.
Traverse array in desc order.
Driver code.
Given array arr [ ].
Function Call"
How can the above be solved in Python?
 ... Give me a code to largest square which can be formed using given rectangular blocks and the other steps required?
assistant
#Here is code to largest square which can be formed using given rectangular blocks and the other steps required.
 def maxSide ( a , n ) :
	sideLength = 0
	a . sort
	for i in range ( n - 1 , - 1 , - 1 ) :
		if ( a [ i ] > sideLength ) :
			sideLength += 1
		else :
			break
	print ( sideLength )
N = 6
arr = [ 3 , 2 , 1 , 5 , 2 , 4 ]
maxSide ( arr , N )