Cpp Creating Instance Of A Dynamic Array Leetcode Problems Javascript