Skip to content

Instantly share code, notes, and snippets.

@hindenbug
Created June 11, 2014 17:55
Show Gist options
  • Select an option

  • Save hindenbug/41d06fd4663b60dfd47f to your computer and use it in GitHub Desktop.

Select an option

Save hindenbug/41d06fd4663b60dfd47f to your computer and use it in GitHub Desktop.
#Frg Jmp
def solution(x, y, d)
# write your code in Ruby 1.9.3
diff = (y - x)
return 0 if diff.zero?
i = (diff.to_f/d).ceil
return i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment