Meituan interview question

Cumulative Sum over An array/Cumulative Product over An array