DEV Community

loading...

Discussion on: Are these lists equal?

Collapse
aigoncharov profile image
Andrey Goncharov

A great example of how one can sacrifice memory for CPU time! However, what is the point of counting if by the original condition "You can assume that there's no duplicate item in any of the lists". We might as well use sets here for simplicity.

Collapse
caroso1222 profile image
Carlos Roso Author

Yeah, a set would work perfectly well. That's the kind of realization I wanted from the post. I'd rather write about the general use case to have readers drill down to more optimal solutions.