static void Main(string[] args) { var numArray = new NumArray(new [] { -1 }); Console.WriteLine(numArray.SumRange(0, 0)); numArray.Update(0, 1); Console.WriteLine(numArray.SumRange(0, 0)); }
private void Form1_Load(object sender, EventArgs e) { int[] nums1 = new int[0]; //for (int i = 0; i < 10; i++) //{ // nums1[i] = i; //} NumArray numArray1 = new NumArray(nums1); //numArray1.Update(0, 2); int sum = numArray1.SumRange(1, 3); }