Pattern Questions In Leetcode Javascript