Easy303 Easy633
package easy; public class e303 { private int[] sums; public e303(int[] nums) { sums = new int[nums.length+1]; for (int i = 0; i < nums.length; i++) sums[i+1] = sums[i] + nums[i]; } public int sumRange(int i, int j) { return sums[j+1] - sums[i]; } public static void main(String[] args) { int[] nums = {-2, 0, 3, -5, 2, -1}; e303 obj = new e303(nums); int param_1 = obj.sumRange(2, 5); System.out.println(param_1); } }