• + 0 comments

    def kangaroo(x1, v1, x2, v2): #check if both vectors are same if v1==v2: return 'NO' else: #verify if the intervel where the kangaroos are meeting is grater than 0 as the vectors are moving positively i = math.ceil(((x1-x2)/(v2-v1))) if i > 0 and (x1 + v1*i) == (x2 + i*v2) : return 'YES' else: return "NO"