Leetcode Implement Dynamic Array Solution Hackerrank C