2 Comments

"This code works but it's quite verbose." There's also a more important efficiency problem. The first solution has time complexity O(n^2) while the Set solution has time complexity O(n).

Expand full comment