Created
September 8, 2017 19:15
-
-
Save adyngom/5aafc701025767c4a593b7a7b1c03515 to your computer and use it in GitHub Desktop.
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 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