If number is neither same as previous nor as current .
else { longest = max ( longest , currentCount + prevCount ) ; prev = current ; prevCount = currentCount ; current = next ; currentCount = 1 ; } } return max ( longest , currentCount + prevCount ) ; }