Skip to content

Instantly share code, notes, and snippets.

@Underdoge
Created February 24, 2017 22:49
Show Gist options
  • Save Underdoge/d38f3a9fce5899149e16f3af173b597d to your computer and use it in GitHub Desktop.
Save Underdoge/d38f3a9fce5899149e16f3af173b597d to your computer and use it in GitHub Desktop.
isSmooth
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