You are viewing a single comment's thread. Return to all comments →
The indexOf() has a worst case compelxity of O(mn). USing it inside the loop will make the complexity of the code to be O(n^2).
Seems like cookies are disabled on this browser, please enable them to open this website
Two Strings
You are viewing a single comment's thread. Return to all comments →
The indexOf() has a worst case compelxity of O(mn). USing it inside the loop will make the complexity of the code to be O(n^2).