Meituan Interview Question

Cumulative Sum over An array/Cumulative Product over An array