summaryrefslogtreecommitdiff
path: root/progs/unparsable_programs/a606.py
blob: b5699a74264f97bb0c8c47c1294cee2af068abc1 (plain)
1
2
3
4
5
6
def sort_on_occurence(lst): 
	dct = {} 
	for i, j in lst: 
		dct.setdefault(i, []).append(j) 
	return ([(i, *dict.fromkeys(j), len(j)) 
				for i, j in dct.items()])