title: Finding indices of max value in swift array
body: <p>I have 2 arrays. One for players and one for scores. e.g.</p>
  
  <pre><code>var players = ["Bill", "Bob", "Sam", "Dave"]
  var scores = [10,15,12,15]
  </code></pre>
  
  <p>I can find the index of the (first) max score (and the winner's name) by using:</p>
  
  <pre><code>let highScore = scores.max()
  let winningPlayerIndex = scores.index(of: highScore!)
  let winningPlayer = players[winningPlayerIndex!]
  </code></pre>
  
  <p>This works fine if there is only one player with the highest score but how would I return multiple indices (i.e. 1 and 3 in this example) for all values that are equal to the max value? I need the indices to then map back to the players array to pull out the names of all the players with the highest score. Or is there a better way to do all of this?</p>