title: Finding differences in a array
body: <p>I'm not sure how to set the differences to store in the array differences. The numbers stored should be 5-(1+2+3), 7-(1,2,4), 8-(3,5,9) : the output should be differences[0]= 1, differences[1] = 0, differences[2] = 9</p>
  
  <pre><code>  import java.util.Scanner;
  
      public class Main {
        public  static int[][] Array = { { 5, 1, 2, 3 }, { 7, 1, 2, 4 }, { 8,3,5,9 } };  //My 2D array//
        int [] differences = new int [3];
  
        public static int[] Sum(int[][] array) {
          int index = 0; //setting the index to 0//
          int temp[] = new int[array[index].length]; //making a temperary variable//
          for (int i = 0; i &lt; array.length; i++) {
            int sum = 0;
            for (int j = 1; j &lt; array[i].length; j++) {
              sum += array[i][j]; //going to add the rows after the first column//
            }
            temp[index] = sum;
  
            for(int a = 0; a&lt;differences.length; a++){
              if(sum != array[index][0])
                sum -= array[i][j];
  
  
  
  
                System.out.println("the first integer " + array[index][0] + " the answer is " + sum); //going to print out the first integer each row and print out the sum of each row after the first column//
              index++; //index is going to increment//
            }
            return temp;
          }
  
          public static void main(String[] args) {
            new Main().Sum(Array);
          }
        }
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>    the first integer 5 the answer is 6
      the first integer 7 the answer is 7
      the first integer 8 the answer is 17
  </code></pre>