Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 316 Bytes

File metadata and controls

15 lines (10 loc) · 316 Bytes

Largest elements in an array

Given an array with k distinct elements, write a function to return all elements that have at least two elements greater than themselves in the same array:

For example, given the following array:

array = [2,3,9,7,6]

Your function should return:

[2,3,6]