Pergunta de entrevista da empresa Alarm.com

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