title: int[] cannot be converted to int return statement
body: <p>I am making a program where the method <code>kthDataValue</code> returns the kth data value when the data values are considered in sorted order. The error says that <code>int[]</code> cannot be converted to <code>int</code> with the <code>return</code> statement.</p>
  <pre><code>public static int kthDataValue(int[] tally, int k) {
      int[] array = new int[k];
      for (int x = 0; x &lt; tally.length; x++) {
          if (tally[x] &gt; 0) {
              for (int z = 0; z &lt; tally[x]; z++)
                  array[x] = x + 1;
          }
      }   
      return array;
  }
  </code></pre>