This goes from O(n^2) to O(n) when map lookup is O(1). I never really focused on much optimizing, but I noticed this one in passing.
This goes from O(n^2) to O(n) when map lookup is O(1). I never really focused on much optimizing, but I noticed this one in passing.