Trading space for time
Also written: trade space for time
Using extra memory, such as a set or dict, to make a solution faster, so each lookup is O(1).
Also written: trade space for time
Using extra memory, such as a set or dict, to make a solution faster, so each lookup is O(1).