Leetcode Minimum Swaps To Sort Arraylist Algorithm