Visa Inc. Interview Question

array list swapping and trying to find the minimum value