Quick Sort Leetcode Problems Javascript