Basic Algorithms For Leetcode Javascript