Leetcode Dynamic Array Problems Geeksforgeeks Java