10
Last seen 6 years ago
Member for 9 years, 4 days
Difficulty Normal
Super clever! Great job.
I'm still trying to figure out how the 'Star Wars' plays into all of it. Any hints? :P
More
Nice use of list comprehension here. Simple, clean, elegant - and one line!
More
You can make this even shorter using list comprehensions!
Saves time from initializing the object and looping over 'data' separately.
More
Nice use of re! I am personally a fan of wrapping the code to maintain readability; however, you've shown a clever way of getting it all down to one line!
More
The re model is not 100% necessary, per se; however, your approach is very readable and clear.
Helpful documentation too! Well done!
More
Very clever!
As a linguist, do you happen upon NLTK a lot as well? I'd be curious how the code would change if you could import it in
More
Nice! Almost a one-liner. Perhaps wrap it around the 80-mark for readability?
I used Counter from collections for this - I'd be curious which would be faster at the end of the day.
More
The for loops seem a bit inefficient in terms of speed (though I would imagine your approach has its memory benefits)
Have you thought of using Counter to develop a tally of char frequencies and going from there?
More
Have you thought of using a Counter object from collections and sorting that? Not sure which would be faster.
More