Skip to content

Instantly share code, notes, and snippets.

@famousgarkin
Created August 23, 2016 13:55
Show Gist options
  • Save famousgarkin/77d5b2a8d17dbd605600a0afc3b6831f to your computer and use it in GitHub Desktop.
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/)
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