I usually just run them from tests so my times are...
# advent-of-code
t
I usually just run them from tests so my times are weird. If I don't do that I get 16/47
w
Im guessing the groupingBy in part 1 slows you down, since it always groups by every letter
t
Yeah, true. But I can't figure out a way around that because if a string has two groups of two, only one counts. So don't I need to go through them all anyway?
w
Yeah. Your approach is easier to follow than mine, but mine checks each letter at a time, counting instances, and just finds if any appears exactly twice, so it can stop looking if it finds one
Mine might be slower if the keys were very long