An array is perfect if the sum of array i array i The applications of Prefix Sum array are: Used to answer range- sum -query, range-xor-query etc. Used to find subarray with max sum . Used to find subarray with sum closest to given number. Used to find equal length and equal sum subarrays of 2 arrays .