AboAbdoMC's blog

By AboAbdoMC, history, 3 years ago, In English
  • Vote: I like it
  • +10
  • Vote: I do not like it

| Write comment?
»
3 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

I think so but it is an old problem so maybe bad test cases?

»
3 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

This solution uses ovidiush11's trick. String erase is apparently O(0). I hope he can explain with more details because I am not good enough for this obscure idea yet.

Marinush

»
3 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

It is $$$O(n^2)$$$, but all your operations are basically memcpy, so the constant factor is really small.

»
3 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

order is n^2 but Coefficient is small