HackerRank Array Reversal in c problem solution - TheCScience