Skip to content

Instantly share code, notes, and snippets.

@natchiketa
Created June 23, 2015 20:00
Show Gist options
  • Save natchiketa/2b6a5d9d7566dc058470 to your computer and use it in GitHub Desktop.
Save natchiketa/2b6a5d9d7566dc058470 to your computer and use it in GitHub Desktop.
Minimum number of frog jumps
function toInt(value) {
return ~~value;
}
function minFrogJumps(X, Y, D) {
var a = Y / D;
var b = X / D;
return toInt(Math.ceil(a -b));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment