We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Collections
- Company Logo
- Discussions
Company Logo
Company Logo
Sort by
recency
|
1256 Discussions
|
Please Login in order to post a comment
fixed: words = {}
if name == 'main': s = input()
I have just started learning and I was not aware of Counter Class and the method most_common()
Glad I came accross Boki's solution from 9 years back! Classes are a bit tough to understand though so I made something of my own.
Does anyone know why i keep getting this wrong:
import math import os import random import re import sys
words = {}
if name == 'main': s = input()
As a one-liner (with one import:
from collections import Counter
):