Leetcode Medium Level Arraylist Syntax C