After extensive processing for the given function I keep getting 2 tests failed out of 20. I am pretty sure that my logic is correct. Does anyone else have the same issue? Please let me know. 2021-12-21T22:00:00Z
Hey, can you mention which tests are failing?
Hi.
I have the same problem @Tassos . The two tests my function fails are the following:
Wrong output type.
Expected: 7130.
Got: 7154.
Wrong output type.
Expected: 14206.
Got: 14352.
I’m getting the same error as Damien_Fournier above and would love some help here.
Hi.
Remember to control for the effect of the allow_switches variable in the edit_one_letter function. Think about the effect of allow_switches = False.
Same problem as Damien_Fournier & David_Plon. Tried to disable the switch in edit_one_letter function when implementing the edit_two_letters function, but new error raised as below:
Wrong output type.
Expected: 7130.
Got: 7154.
Wrong output type.
Expected: 14206.
Got: 14351.
Wrong output type.
Expected: 14352.
Got: 14351.
(3/20 tests failed)
Hi mingqi,
Try to handle the value of the allow_switches variable in the edit_one_letter function itself. Hope this helps.
This was a lifesaver. Thanks Reinoud.
Thank you So Much~~!!!
I got the proper answer
Did you resolve this? I am stuck at the same place
This happens once u post in stackoverflow or somewhere the solution gets clear in your mind.
Yes, resolved it within minutes of posting
Hello i used allow_switches == False but now the expected output is anyone can help me to find whats going wrong?
After 1st edit, some words will end up “”. Make sure you send a proper word to 2nd edit.
Hi,
I’m stuck with similar error. I get this:
Played around with verbose and eliminating empty words. Neither helped.
Hello reinoudbosch, I still cannot get over the error after reading your hint. I do not know whether the “allow_switches==False” should be set in the first edit_one_letter function or in the second or both of them. I cannot think of anything else to do in the edit_one_letter function but to ignore the swtich_letter part when allow_switches is set to false. There must be something I overlooked, but can you make it more explicit?
Hi Zhefei-Meng,
You have to deal with it in the edit_one_letter function, as this is where you want to decide whether or not to allow switches. Try to think of the logic involved: if allow_switches is True then do A, if allow_switches is False then do B.
Thank you and now I have made it correct. It was because that I forgot to take the allow_switches argument in the edit_two_letters into consideration as well. And edit_one_letter with allow_switches=True can be allowed to do it twice when allow_switches=True is set in edit_two_letters since zero edit is allowed here, hence it is not a problem for me.
My question is solved and thank you.
Hi, I seem to be having a problem here too
I had the same problem, after reading your post I finally realized that I had missed the same thing. Thank You!