• + 0 comments

    v1 should be greater than v2 so that 2 animals can land at the same time.Hence check for v1-v2 first to avoid divide by zero exception. Then check if((x2-x2)%(v1-v2)) == 0 return yes else return no