4 ms·
Maybe author means that it is iterating all the way up to len(input) instead of len(input) - len(word) Or instead of checking j == len(word)-1 inside the inner
by shultays 4y ago
Maybe author means that it is iterating all the way up to len(input) instead of len(input) - len(word)
Or instead of checking j == len(word)-1 inside the inner loop, you could do that outside, after the loop and return true there
Both are a lot more nitpicky. But author's point is the code is not "wrong" but it is not great either