Leetcode 1471. The k Strongest Values in an Array
Find the centre (the element at index (nā1)/2 of the sorted array) and return any k elements with the largest "strength", where strength = |x ā centre| and ties are broken by the larger value ā i.e., pick the top-k elements by distance from the centre.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.