title: Code compiles and executes, but does not print anything
body: <p>The time-limit-extended is the status when executing the successfully compiled class file of the following code.</p>
  
  <pre><code>import java.io.*;
  public class CandidateCode {
  
      public static int ThirstyCrowProblem(int[] input1, int input2, int input3) {
          int[] arrK = new int[input3];
          int minstones = 0;
          for (int i = 0; i &lt; input3; i++) //create an array of k Os.
          {
              int smallest = input1[0], place = 0;
              for (int j = 0; j &lt; input2; j++) {
                  if ((smallest &gt;= input1[j]) &amp;&amp; (input1[j] &gt;= 0)) {
                      smallest = input1[j];
                      place = j;
                  }
              }
              input1[place] = -1;
              arrK[i] = smallest;
          }
          int n = input2, i = 0;
          while (i &lt; input3)
          minstones = minstones + arrK[i] * (n - i);
          return minstones;
      }
  
      public static void main(String[] args) {
          int[] arr = new int[] {
              5, 58
          };
          int stones_min = CandidateCode.ThirstyCrowProblem(arr, 2, 1);
          System.out.println("The result is" + stones_min);
      }
  }
  </code></pre>
  
  <p>The cursor is waiting and waiting, but I don't think there is an error in the code!??</p>