Quick Sort Problem In Leetcode Javascript