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]