if both a and b are equal then arr [ i ] is a perfect square
if ( a == b ) current_length ++ ; else current_length = 0 ; max_length = Math . max ( max_length , current_length ) ; } return max_length ; }