diff --git a/HackerRank-Kangaroo/Kangaroo.py b/HackerRank-Kangaroo/Kangaroo.py index b5b82b8..d5c4533 100644 --- a/HackerRank-Kangaroo/Kangaroo.py +++ b/HackerRank-Kangaroo/Kangaroo.py @@ -8,12 +8,21 @@ # Complete the kangaroo function below. def kangaroo(x1, v1, x2, v2): - for n in range(10000): - if((x1+v1)==(x2+v2)): - return "YES" - x1+=v1 - x2+=v2 - return "NO" + while(True): + if(v1>v2 and x1v1 and x2