title: Enumerable.Max() if two max values
body: <p>I'm trying to get the maximum value from an array of integers but if there are two values which are considered maximum, I need to find their index in the array.</p>
  
  <p>I.e. If I have the array:
  {10, 13, 13, 9, 8}
  I need to find the index of both the 13 values</p>
  
  <p>If I have the array:
  {10, 13, 12, 9, 8}
  I need to just return the index of the 13</p>
  
  <p>I have done the second part of this by using
      <code>myArray.ToList().IndexOf(myArray.Max());</code></p>
  
  <p>But can't figure out the first example.</p>