kamyu104/LeetCode-Solutions

why is it linear?

AndrewLisuxin opened this issue · 1 comments

elif last_p_ptr != -1:

Seems it is DFS, every time you first match a '*' with empty string. When facing trouble, you trace back to
match it with one char, and so on. Why is it linear?

Yes, you are right. It is not linear.
At worst, it would be Time: O(m * n).