Pregunta de entrevista de Alarm.com

Stack manipulation, find minimum number of swaps to sort array, array searching