title: Return the index of max value from an array
body: <p>I want to loop over the parameter vector and find which is the biggest index. If the biggest index exists in multiple places it is going to return the highest index value.</p>
  
  <p>Could someone explain what I'm doing wrong?</p>
  
  <pre><code>static int maxIndex(int vector[]) {
      int maxIndex = 0;
      for (int i = 1; i &lt; vector.length; i++) {
  
          if (vector[i] &gt;= vector[maxIndex]) {
              maxIndex = i;
          }
      }
  
      return maxIndex;
  }
  </code></pre>