Leetcode Solutions In Javascript Object Arrays