Pergunta de entrevista da empresa Visa Inc.

array list swapping and trying to find the minimum value