![Bob Belderbos on X: "Finding the most frequent element in a collection using a single line of code? -> collections.Counter() is your go-to utility 🐍 😍 #python #tip https://t.co/TD4rdcI7aq" / X Bob Belderbos on X: "Finding the most frequent element in a collection using a single line of code? -> collections.Counter() is your go-to utility 🐍 😍 #python #tip https://t.co/TD4rdcI7aq" / X](https://pbs.twimg.com/media/GHRRfk1WwAA3hAI.jpg:large)
Bob Belderbos on X: "Finding the most frequent element in a collection using a single line of code? -> collections.Counter() is your go-to utility 🐍 😍 #python #tip https://t.co/TD4rdcI7aq" / X
![Practice>Python>Collections>collections.Counter() · Issue #76 · jmpark0118/CODING_TEST_PRACTICE · GitHub Practice>Python>Collections>collections.Counter() · Issue #76 · jmpark0118/CODING_TEST_PRACTICE · GitHub](https://user-images.githubusercontent.com/47072401/97177130-5b2dc380-17d9-11eb-8c5b-5b5219773061.png)
Practice>Python>Collections>collections.Counter() · Issue #76 · jmpark0118/CODING_TEST_PRACTICE · GitHub
![デイヴ on X: "#AdventOfCode2020 Day 6 in #Python from collections import Counter data = [ (Counter(l.replace('\n', '')), len(l.split('\n'))) for l in open('06').read().split('\n\n') ] print('Pt 1:', sum(len(g) for g,_ in data), '\nPt 2:', デイヴ on X: "#AdventOfCode2020 Day 6 in #Python from collections import Counter data = [ (Counter(l.replace('\n', '')), len(l.split('\n'))) for l in open('06').read().split('\n\n') ] print('Pt 1:', sum(len(g) for g,_ in data), '\nPt 2:',](https://pbs.twimg.com/media/EpIe3NLXUAAT8rh.jpg:large)