+ 1

How Far? Challenge, I don't think im understand why checks 3 and 4 are not correct i did some debuging with different strings

https://code.sololearn.com/cF258venSz9w/?ref=app

17th Jul 2022, 7:22 PM
Jakub Quinn
Jakub Quinn - avatar
8 odpowiedzi
+ 4
After testing couple possibilities, finally I found it may be that the path may from left to right or right to left. Reverse finding path, got test 3,4 passed. Should mention in task, may left it user think.
17th Jul 2022, 8:23 PM
Jayakrishna 🇮🇳
+ 3
Jayakrishna🇮🇳 You are walking from your house to a pond that is down your street. How many blocks over will you have to walk until you get to the pond? Task: Evaluate how many blocks you will have to walk if you are given a representation of your street where H represents your house, P represents the pond, and every B represents a block in between the two. Input Format: A string of letters representing your house, the pond, and blocks on your street. Output Format: An integer value that represents the number of blocks between your house and the pond. Sample Input: BBHBBBBPBBB Sample Output: 4 Explanation: There are 4 blocks between your house and the pond on your street.
17th Jul 2022, 8:09 PM
BroFar
BroFar - avatar
+ 2
Ok thank you kinda destroys my code idea lol
17th Jul 2022, 8:27 PM
Jakub Quinn
Jakub Quinn - avatar
+ 1
All strings i did worked fine so what am i missing
17th Jul 2022, 7:22 PM
Jakub Quinn
Jakub Quinn - avatar
+ 1
Its the How Far? Challenge its in the medium level
17th Jul 2022, 7:32 PM
Jakub Quinn
Jakub Quinn - avatar
+ 1
Make use of IndexOf() method for simplicity instead of loop.. Hint. You're welcome..
17th Jul 2022, 8:29 PM
Jayakrishna 🇮🇳
0
What is the challenge there , add the description pls..
17th Jul 2022, 7:24 PM
Jayakrishna 🇮🇳
0
In requirement they should mention , what if pond comes first, only it mentions if house comes first,i tried lot debugging, they reverse came in my mind & it worked!! I believe tester put wrong test case!he didnt got requirement properly!
27th Sep 2022, 5:13 AM
Roopam
Roopam - avatar