You are viewing a single comment's thread. Return to all comments →
I dont't think that this is O(n). The .replace() scans the char[] and you call it twice inside the for loop. So I think it's O(n²).
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
I dont't think that this is O(n). The .replace() scans the char[] and you call it twice inside the for loop. So I think it's O(n²).