Last active
February 24, 2017 04:26
-
-
Save Underdoge/3435de664698a26043823b7c38c50a84 to your computer and use it in GitHub Desktop.
Make Array Consecutive 2
This file contains 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 makeArrayConsecutive2(statues) { | |
statues=statues.sort((a,b)=>a-b); | |
return(statues[statues.length-1]-statues[0]+1-statues.length); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment