Generation

generate functionSat, 12 Nov 2022

in a list of pairs, return element where the first element is the greatest

def maxPair(pairs: List[(Int, Int)]): (Int, Int) = { pairs.maxBy(_._1) }

Want to kickstart your project?Use the new AI Studio to create your code