| ▲ | jooz 5 hours ago | |
When I train some leetcode problems, I remember the best solution was the one that optimised cpu (time) instead of memory. Meaning adding data index in memory instead of iterating on the main data structure. I thought, ok, thats fine, it's normal, you can (could) always buy more RAM, but you can't buy more time. But well, I think there is no right answer and there always be a trade off case by case depending on the context. | ||