Sum of Indices for Good Subarrays

Company: Infosys SP

Difficulty: medium