Check if arr [ i ] is a perfect number
if ( isPerfect ( arr [ i ] ) ) { current_length ++ ; } else { current_length = 0 ; } max_length = Math . Max ( max_length , current_length ) ; } return max_length ; }