Amazon interview question

dsa question of sub array sum and other was a leetcode hard problem