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 went all the way from 451mb of memory to 286mb on the worst case. Maybe using an object with a list and slots or a subclass of list with slots could use even less, but now I'm tired and want to sleep :)
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 →
my solution was simple, if having a node costs too much memory, why not just keep the dictionaries:
it went all the way from 451mb of memory to 286mb on the worst case. Maybe using an object with a list and slots or a subclass of list with slots could use even less, but now I'm tired and want to sleep :)