Created
February 24, 2017 22:49
-
-
Save Underdoge/d38f3a9fce5899149e16f3af173b597d to your computer and use it in GitHub Desktop.
isSmooth
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 isSmooth(arr) { | |
return (arr.length%2==0) ? arr[0]===arr[arr.length-1]&&arr[0]===(arr[arr.length/2-1]+arr[arr.length/2]):arr[0]==arr[arr.length-1]&&arr[0]==(arr[Math.floor(arr.length/2)]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment