One strategy would be to add an optional argument in which the number of displayed teams can be specified. For challenges with 200 participants, even multiple columns might be confusing.
The plots can already be limited to the top x performing algorithms. This can be reused in that case. Then the question is how many legend items are we going to "guarantee" appearing nicely?