Question d’entretien chez Salesforce

How to find closest minimum element in an array(Using stack)