Good problem!
It is easy if you use matlab function...
useful function ==> categorical, countcats , sort, unique
solution:
https://github.com/AhmedNazir/MatlabCody/blob/master/popularity.m
this type of hack solutions should be banned
The behavior of accumarray has changed. In R2012b, I used I = accumarray(I.', 1); and it worked. I had to remove the transpose to pass the test suite.
Interesting cody behavior by masking anonymous functions with str2num...
Test Suite having a hissy fit because it wanted a col not a row o_O
Sort a list of complex numbers based on far they are from the origin.
4348 Solvers
Return the first and last characters of a character array
3675 Solvers
225 Solvers
Who has power to do everything in this world?
321 Solvers
258 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!