Largest elements in an array
Question
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:
[2,3,6]