human
Length of largest subarray whose all elements are Perfect Number | Function that returns true if n is perfect.
To store sum of divisors.
Find all divisors and add them.
check if the sum of divisors is equal to n , then n is a perfect number.
Function to return the length of the largest sub - array of an array every element of whose is a perfect number.
check if arr [ i ] is a perfect number.
Driver code"
Solution in Python:

What is a code to length of largest subarray whose all elements are Perfect Number and the other steps required?
assistant
#Here is code to length of largest subarray whose all elements are Perfect Number and the other steps required.
 def isPerfect ( n ) :
	sum = 1
	i = 2
	while i * i <= n :
		if n % i == 0 :
			sum = sum + i + n / i
		i += 1
	return ( True if sum == n and n != 1 else False )
def contiguousPerfectNumber ( arr , n ) :
	current_length = 0
	max_length = 0
	for i in range ( 0 , n , 1 ) :
		if ( isPerfect ( arr [ i ] ) ) :
			current_length += 1
		else :
			current_length = 0
		max_length = max ( max_length , current_length )
	return max_length
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 7 , 36 , 4 , 6 , 28 , 4 ]
	n = len ( arr )
	print ( contiguousPerfectNumber ( arr , n ) )