Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thank you!
This comment is hidden because it contains spoiler information about the solution
You're very welcome! Party on.
It's a lot of code to find
max_freq
, but it's good that you filtermost_feq_elements
simply. Much of the first half can be simplified by compounding multiple statements, such asinto the one-liner
Always try to eliminate unnecessary variables, in this case
v
. Usually it is good to have explicit variable names to make your code more readable, but sometimes doing more in each line can make things more readable by reducing the numbers of steps and variables.Thank you! It is a nice way of one-lining the solution without any imports. However, swk000@gmail.com is right in saying (in the comment on kgashock's fork) that it is very inefficient. Re-calculating the max for every x delivers N^2 complexity. This would we terrible except for the fact that it's on one line which nullifies any optimization complaints. I mean, look at it, it's adorable...