Created
August 23, 2016 13:55
-
-
Save famousgarkin/77d5b2a8d17dbd605600a0afc3b6831f to your computer and use it in GitHub Desktop.
Codility - Lesson 3: Time Complexity - FrogJmp (https://codility.com/programmers/task/frog_jmp/)
This file contains hidden or 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) { | |
return Math.ceil((Y - X) / D) | |
} | |
var X = 10 | |
var Y = 85 | |
var D = 30 | |
var test = solution(X, Y, D) | |
console.log(test, test === 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment