3 arrays/prefix sum array/main.cpp
//Find sum from l to r indices(inclusive)
Find sum from l to r indices(inclusive)
Find sum from l to r indices ( inclusive )
int findSum(int arr[], int n, int l, int r){
    int p_sum[n];
    generatePrefixSum(p_sum, arr, n);
    if(l == 0){
        return p_sum[r];
    }
    return p_sum[r]-p_sum[l-1];
}
int findSum ( int arr [ ] , int n , int l , int r ) { int p_sum [ n ] ; generatePrefixSum ( p_sum , arr , n ) ; if ( l == 0 ) { return p_sum [ r ] ; } return p_sum [ r ] - p_sum [ l - 1 ] ; }
Find sum from l to r indices(inclusive)
Find sum from l to r indices ( inclusive )