Important Array Leetcode Problems Javascript Code