fork download
  1. # coding: utf-8
  2. from itertools import product, groupby
  3. s=["○", "○", "○", "△", "△", "×"]
  4. print sorted(((lambda h:(h[0], len(h)))(list(g))
  5. for _,g in groupby(sorted(map(lambda i:''.join(sorted(i)),
  6. product(s, repeat=2))))),
  7. key=lambda (l,r):r,
  8. reverse=True)
Success #stdin #stdout 0.01s 7728KB
stdin
Standard input is empty
stdout
[('\xe2\x96\xb3\xe2\x97\x8b', 12), ('\xe2\x97\x8b\xe2\x97\x8b', 9), ('\xc3\x97\xe2\x97\x8b', 6), ('\xc3\x97\xe2\x96\xb3', 4), ('\xe2\x96\xb3\xe2\x96\xb3', 4), ('\xc3\x97\xc3\x97', 1)]