python collections counter time complexity