Extending nums doesn't really create a new list. If you check its id before and after they are still the same. Regardless, that portion of the code could be changed to:
I still have a lot to learn about big O notation myself. I'm not a professional coder so finding the time to learn takes a lot of effort. Also, not having a use/case for things makes it that much harder to stay focused on certain subjects.
Once again, I'm really impressed with all that you've been doing. It's very inspirational and motivates me to get my butt in gear!
Extending nums doesn't really create a new list. If you check its
id
before and after they are still the same. Regardless, that portion of the code could be changed to:And still accomplish the same and be just as fast.
I still have a lot to learn about big O notation myself. I'm not a professional coder so finding the time to learn takes a lot of effort. Also, not having a use/case for things makes it that much harder to stay focused on certain subjects.
Once again, I'm really impressed with all that you've been doing. It's very inspirational and motivates me to get my butt in gear!
I am an absolute beginner in this time complexity thing as well. What I meant by extra memory was. When you do
[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.