You are viewing a single comment's thread. Return to all comments →
Actually I'm not sure why but I tested dictionary types a few times in competitions to save a few secs and defaultdict had been always fastest. Weird thing is your use of counter is same with defaultdict but according to python.org it's same with Dict. Here is one of the test links I found, some others says speed difference is bigger.