Selection Sort Problem In Leetcode 1501