title: java array method to return an array
body: <p>I want to return an array for the below method.</p>
  
  <p>But I can't figure it out how? 
  m,n to be included in the array</p>
  
  <pre><code>static int[] records(int[] score) {
      int m=0,n=0;
      int max = score[0],min = score[0];
  
      for(int i=1;i&lt;score.length;i++){
          if(score[i]&gt;max){
              m+=1;
              max = score[i];
          }
          if(score[i]&lt;min){
              n+=1;
              min = score[i]; 
          }
      }
  }
  </code></pre>