We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It may work as lists have to use additional memory to amortize possible future 'appends'. Although the whole problem is that in Python any self creating objects are just taking too much memory upon their creation in contrast to primitives. I suspect this happens because primitives like strings because they are implemented in C internally. It will be interesting to see if LinkedList can do the job.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tries: Contacts
You are viewing a single comment's thread. Return to all comments →
It may work as lists have to use additional memory to amortize possible future 'appends'. Although the whole problem is that in Python any self creating objects are just taking too much memory upon their creation in contrast to primitives. I suspect this happens because primitives like strings because they are implemented in C internally. It will be interesting to see if LinkedList can do the job.