HackerRank Dynamic Array in C problem solution - TheCScience