HockeyStack Interview Question

Some prefix sum question from leetcode