Skip to content

Instantly share code, notes, and snippets.

@adyngom
Created September 8, 2017 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adyngom/5aafc701025767c4a593b7a7b1c03515 to your computer and use it in GitHub Desktop.
Save adyngom/5aafc701025767c4a593b7a7b1c03515 to your computer and use it in GitHub Desktop.
function solution(X, Y, D) {
// write your code in JavaScript (Node.js 6.4.0)
if( D <= 0 || Y <= X ) return 0;
var J = Math.ceil( ( Y - X) / D );
return J;
}
console.log( solution(10, 85, 30) ); // 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment