My implementation is perfect but I am only able to pass 5 out of the 6 test cases.
Somehow there is a bigram in my trigrams
My implementation is perfect but I am only able to pass 5 out of the 6 test cases.
Somehow there is a bigram in my trigrams
This strongly suggests your implementation is not perfect.
I implemented just as it was taught in the course. Can you please look at the code, and tell me where I went wrong
No, I cannot do that. I am not a mentor for that course.
just as tip … for i in range(len(sentence)-n+1)
I had the same problem. Note that the expected solution asks for ‘-2’ instead of ‘<e>’ and ‘-1’ instead of ‘<s>’. We have a tendency not to read the arguments of the functions and to hard-code everything.( Hope it helps