public static void main(String args[]) {
        int[][] input = {{3, 0, 1, 4, 2},
                        {5, 6, 3, 2, 1},
                        {1, 2, 0, 1, 5},
                        {4, 1, 0, 1, 7},
                        {1, 0, 3, 0, 5}};

        int[][] input1 = {{2,0,-3,4}, {6, 3, 2, -1}, {5, 4, 7, 3}, {2, -6, 8, 1}};
        Immutable2DSumRangeQuery isr = new Immutable2DSumRangeQuery(input1);
        System.out.println(isr.sumQuery(1, 1, 2, 2));
    }
Date 03/11/2016
@author Tushar Roy

Given a 2D array find the sum in given range defining a rectangle.

Time complexity construction O(n*m)
Time complexity of query O(1)
Space complexity is O(n*m)

Reference
https://leetcode.com/problems/range-sum-query-2d-immutable/
src/com/interview/dynamic/Immutable2DSumRangeQuery.java