17
Last seen 3 months ago
Member for 9 months, 24 days
Difficulty Normal
Interesting solution. I think using an OrderedDict rather than a Dict would save you making tlist and sorting that as this would maintain the order the keys/values were added and so you wouldn't need to sort by original order.
More
You could do something like this instead of all the replacement of symbols and digits:
newtext = ''.join(i for i in text.lower() if i in string.ascii_lowercase)
More
Nice, simple solution. You could do 'for i in set(data)' to save some unnecessary loops.
More
This is good, the only thing I would say is that you could do 'for i in set(data)' as this would reduce the number of loops that would need to be done as you would only count each unique item in data.
More
Nice solution. Any paricular reason to reverse the sort and use [-1] to reference the end? Rather than doing a standard sort and indexing to [0].
More
This does the job...but your 'elif num % 3 == 0' and 'elif num % 6 == 0' checks will never return True.
More
This works but it's a bit inefficient as you're counting items multiple times and returning i to 0 every time you make a change in the array. You could count each element once, and then sort based on that count.
More
Good use of the f-string and the re groups. You could replace [^ ] with . to match any character, but the function is the same.
More
I think you could do better using set(text) as this gives you a set of each unique element of the text and you can use this to perform your count.
More