Leetcode Selection Sort Algorithm