How To Approach Leetcode Problems Javascript