DEV Community


Discussion on: Are these lists equal?

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.

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.