human
Minimum number of squares whose sum equals to given number n | Returns count of minimum squares that sum to n.
base cases.
getMinSquares rest of the table using recursive formula Maximum squares required is n ( 1 * 1 + 1 * 1 + . . ).
Go through all smaller numbers to recursively find minimum.
Driver code"
Solution in Python:
 ... Give me a code to minimum number of squares whose sum equals to given number n and the other steps required?
assistant
#Here is code to minimum number of squares whose sum equals to given number n and the other steps required.
 def getMinSquares ( n ) :
	if n <= 3 :
		return n ;
	res = n
	for x in range ( 1 , n + 1 ) :
		temp = x * x ;
		if temp > n :
			break
		else :
			res = min ( res , 1 + getMinSquares ( n - temp ) )
	return res ;
print ( getMinSquares ( 6 ) )