Problem 1471 · Medium

The k Strongest Values in an Array

Select the k values farthest from the median in value, with ties broken by size. The visual sorts the array and marks the strongest values from both ends.

Open the interactive visualisation