title: Scala way of applying function to list and getting highest result with input
body: <pre><code>best_acc = 0
  for split in split_candidates:
      acc = self.get_split_score(t_series_distances, split)
      if acc &gt; best_acc:
          best_acc = acc
          best_split = split
  return best_acc, best_split
  </code></pre>
  
  <p>What is the scala way of doing this ? I need to apply get_split_score function to a collection and get the highest value this function outputs as well as the input(element in original list) that caused this output.</p>