Pergunta de entrevista da empresa Microsoft

Find the number of swaps required to sort the array