Insertion Sort Problems Leetcode Javascript