Skip to content

Instantly share code, notes, and snippets.

@rafaelbernard
Created January 17, 2016 03:01
Show Gist options
  • Save rafaelbernard/808f0ad667714c86bdf6 to your computer and use it in GitHub Desktop.
Save rafaelbernard/808f0ad667714c86bdf6 to your computer and use it in GitHub Desktop.
<?php
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($X, $Y, $D) {
// write your code in PHP5.5
if ($X == $Y) return 0;
$jumps = intval(ceil(($Y - $X) / $D));
return $jumps;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment