Array Reduction 3 Leetcode Solution In C