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 = [2,3,9,7,6]

#Your function should return:


Access restricted

Subscribe to premium account to see the solution.

Get premium now