Skip to content

Instantly share code, notes, and snippets.

@kexoth
Created March 18, 2015 01:04
Show Gist options
  • Save kexoth/5e993b79fb62025694fe to your computer and use it in GitHub Desktop.
Save kexoth/5e993b79fb62025694fe to your computer and use it in GitHub Desktop.
function solution(A, B, K) {
return (Math.floor(B/K) - ((A <= 1) ? 0 : Math.floor((A-1)/K))) + ((A === 0)?1:0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment