From ebc531379cb5adf20b2242546dc59c3d226f324a Mon Sep 17 00:00:00 2001 From: thesaurabh4714 <42849052+thesaurabh4714@users.noreply.github.com> Date: Tue, 7 Jul 2020 02:36:16 +0530 Subject: [PATCH] Update Kangaroo.py improved solution --- HackerRank-Kangaroo/Kangaroo.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy