Leetcode Stack And Queue Implementation Java