Skip to content

Instantly share code, notes, and snippets.

@asadali3210 asadali3210/test.php Secret
Created May 31, 2017

Embed
What would you like to do?
function getLongestSequence($arr){
$output =0;
$size =1;
$character = '';
foreach($arr as $char){
if ( $char == $character ){
$size++;
}
else {
if ( $size >= $output){
$output = $size;
$character = $char;
}
$size =1;
}
}
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.