• + 0 comments

    I hope this helps someone who was confused as to why we needed to calculate the mod.

    First of all, as @Mily94 pointed out this problem's solution could be solved using this simply equation:

    x1 + (j * v1) = x2 + (j * v2) where 'j' is the number of jumps.

    Simplifying the equation gives us this: j = (x2 - x1) / (v1 - v2) and in order to figure out if 'j' is a whole number (i.e. if there exists a whole number of jumps that would allow our kangaroos to meet), we have to find out if the remainder of this division is 0, which requires the use of the modulo operator. I hope this makes sense.