Adapted from here, with less terrible instructions and a couple tweaks.

Two kangaroos are jumping on a line. They start out at different points on the line, and jump in the same direction at different speeds. Your task is to determine whether or not they'll ever land in the same spot at the same time (you'll just have to suspend disbelief for a moment and accept that two kangaroos, for the purpose of this kata, can occupy the same space at the same time :)

Your function is given four arguments `(kanga1, rate1, kanga2, rate2)`; the first kangaroo's starting point, the first kangaroo's speed, the second kangaroo's starting point, and the second kangaroo's speed.

Return `true` if the above conditions are met, else `false`. Starting location and speed may vary wildly. The first kangaroo will _usually_ start behind the second one and travel faster, but not always. Starting locations may be negative, but speeds will always be > 0.

**Example:**
![kangaroo](https://i.imgur.com/hXRgSVg.jpg)

**Other examples:**

Brute force solutions are possible (and not discouraged), but you'll save yourself a lot of waiting time if you don't go that route :)

Good luck!

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def kangaroo(kanga1, rate1, kanga2, rate2):
	

Solutions:
def kangaroo(k1, r1, k2, r2):
	if r1 == r2:
		return k1 == k2
	(cross, r) = divmod(k1 - k2, r2 - r1)
	return cross >= 0 and (not r)


def kangaroo(x1, v1, x2, v2):
	if x1 > x2 and v1 > v2:
		return False
	if v1 > v2 and (x2 - x1) % (v1 - v2) == 0:
		return True
	else:
		return False


def kangaroo(kanga1, rate1, kanga2, rate2):
	(k, r) = (kanga1 - kanga2, rate2 - rate1)
	return k % r == 0 if k * r > 0 else k == r


def kangaroo(kanga1, rate1, kanga2, rate2):
	d = kanga1 - kanga2
	s = rate1 - rate2
	return d * s < 0 and (not d % s)


def kangaroo(kanga1, rate1, kanga2, rate2):
	s = kanga1 - kanga2
	v = rate1 - rate2
	return s * v < 0 and (not s % v)


def kangaroo(kanga1, rate1, kanga2, rate2):
	if kanga1 < kanga2 and rate1 <= rate2 or (kanga1 > kanga2 and rate1 >= rate2):
		return False
	else:
		return (kanga1 - kanga2) / (rate2 - rate1) % 1 == 0


def kangaroo(k1, r1, k2, r2):
	dif = r1 - r2
	try:
		(a, b) = (k1 - k2, r1 - r2)
		return a % b == 0 and (a < 0) != (b < 0)
	except Exception:
		return False


def kangaroo(kanga1, rate1, kanga2, rate2):
	if kanga1 == kanga2:
		return True
	elif kanga1 < kanga2:
		velocidad_acercamiento = rate1 - rate2
		if velocidad_acercamiento <= 0:
			return False
		elif (kanga2 - kanga1) % velocidad_acercamiento == 0:
			return True
		else:
			return False
	else:
		velocidad_acercamiento = rate2 - rate1
		if velocidad_acercamiento <= 0:
			return False
		elif (kanga1 - kanga2) % velocidad_acercamiento == 0:
			return True
		else:
			return False


def kangaroo(kanga1, rate1, kanga2, rate2):
	if rate1 == rate2:
		return kanga1 == kanga2
	time_ = (kanga2 - kanga1) / (rate1 - rate2)
	return time_ > 0 and time_.is_integer()