System Design Leetcode Problems Javascript Array Push Pop