Array Reduction

Company: Chubb_India_26nov

Difficulty: medium