4 ms·
Isn't `a=a[2:]` going to copy and make that linear time too? I'm surprised he caught the `b.pop(0)` bug but then suggested doing that afterwards. Also he shoul
by gfd 4y ago
Isn't `a=a[2:]` going to copy and make that linear time too? I'm surprised he caught the `b.pop(0)` bug but then suggested doing that afterwards.
Also he should submit to codeforces to get a comparable running time. For example here is a random person who submitted AlphaCode's version and it takes 1091 ms https://codeforces.com/contest/1553/submission/144971343 https://codeforces.com/contest/1553/submission/144971343
- PartiallyTyped 4y ago> Isn't `a=a[2:]` going to copy and make that linear time too? Afaik it's a memcpy of pointers.
- SekstiNi 4y agoThat would indeed be linear time, but he doesn't make that suggestion as far as I can see.
- gfd 4y agoIt's in the red inked code review image and it's in his rewrite as "source = source[:-2]"