Visa Inc. interview question

array list swapping and trying to find the minimum value