Input : a[] = {2, 8, 7, 1, 5}
Output : 1 2 5
Explanation : The output three elements have two or more greater elements.
---------------->>>>Solution<<<----------
def findElements(self,a, n):
temp = sorted(a)
return temp[-3::-1][::-1]
Input : a[] = {2, 8, 7, 1, 5}
Output : 1 2 5
Explanation : The output three elements have two or more greater elements.
---------------->>>>Solution<<<----------
def findElements(self,a, n):
temp = sorted(a)
return temp[-3::-1][::-1]
@sriv.ansh this is why it is so important to invest time in coding!! This is a great way to explore and become confident in one’s own abilities. Well done!