Created
December 28, 2014 08:05
-
-
Save howtomakeaturn/116603e230da0ea6f49e to your computer and use it in GitHub Desktop.
temp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution($A) { | |
asort($A); | |
$B = array(); | |
foreach($A as $value){ | |
$B[] = $value; | |
} | |
foreach($B as $index => $value){ | |
if (($B[$index+1] != ($value+1)) && ($B[$index+1] != $value)) { | |
return $value + 1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment