I usually just run them from tests so my times are weird. If I don't do that I get 16/47
w
wakingrufus
12/02/2018, 5:26 PM
Im guessing the groupingBy in part 1 slows you down, since it always groups by every letter
t
todd.ginsberg
12/02/2018, 5:35 PM
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
wakingrufus
12/02/2018, 5:46 PM
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