All pastes #2055579 Raw Edit

Miscellany

public text v1 · immutable
#2055579 ·published 2011-05-09 05:28 UTC
rendered paste body
cnt = {'2': 2, '3': 1, '4': 7, '5': 4}

# fill the line below with all possible tiles
tiletypes = {'2': 1, '3': 1, '4': 1, '5': 1}
finalcount = {}

for tile in cnt:
    tiletype = tiletypes[tile]
    finalcount[tiletype] = finalcount.get(tiletype,0) + cnt[tile]

print finalcount