Glossary: Coding Interviews in JavaScript
Trading space for time
Also written: trade space for time
Using extra memory, such as a Set or Map, to make a solution faster. A Set makes each lookup O(1) at the cost of O(n) space.
Glossary: Coding Interviews in JavaScript
Also written: trade space for time
Using extra memory, such as a Set or Map, to make a solution faster. A Set makes each lookup O(1) at the cost of O(n) space.