DEV Community

Discussion on: Day-3 Move Zeroes

 
mridubhatnagar profile image
Mridu Bhatnagar • Edited

I am an absolute beginner in this time complexity thing as well. What I meant by extra memory was. When you do

nums.extend([0] * count)

[0]*count would result in [0, 0, 0]. And this list with [0, 0, 0] will have a different memory id then your nums list.

That try expect thing is really nice. I recently read about it in some blog as well. That this is a good way to do.