Add sorting to Solutions page

I think that Solutions page is quite useless right now. Yes, you can see different approaches people used but you have no idea which of these approaches are actually better or whether there are much better solutions which just haven’t been upvoted yet. The whole upvoting system is broken since most people only look at top 10 solutions and those are already the most upvoted ones so solutions with zero upvotes usually go completely unnoticed.

I propose adding three different ways of sorting for the Solutions page:

  1. By upvotes. No different than the current way.

  2. By characters count. One of my favorite things to do after I solve some puzzle is to search for the shortest solution. Short solutions usually fully exploit the power of used programming language and are a great learning material for those striving to be better programmers. I wanted to propose LOC metric first but then I figured out people would just put 1000 characters in one line where possible (not applicable to languages which use indents heavily like Python but you can make a one-liner from any source code in C++).

  3. By execution time / efficiency. This would be a great way to learn new algorithms. Also it would turn every puzzle on CodinGame into an Optimization challenge with people trying to make their code as efficient as possible. Memory can also be used as an efficiency metric.
    This might mean adding new validators where execution time matters.

I agree with you, currently I think it is not easy to browse through the solutions and identify those which are interesting.

Instead of sorting solutions, it might be easier to categorize them, as this is done in other programming sites like Checkio for example.

4 categories in particular come to mind:

  • Clear for showing how to properly solve the problem using language tools
  • Short for the code-golfing lovers
  • Fast for implementing the algorithm with lowest time complexity
  • Creative for sharing alternative and innovative ways to solve the problem

When publishing a solution, a CodinGamer could select the category to which he thinks his solution belongs. And when browsing the solutions, a CodinGamer could easily select what kind of solution he wants to read.

Also, this has the advantage of not having for CodinGame to judge the speed of a solution, as it has been proposed many times, but seemed complicated.

Finally, I think it would also be very useful and convenient if it was possible to give names to the solutions that we publish.