我有雙ReduceLeft with Vector of pairs?
Vector((9,1), (16,2), (21,3), (24,4), (25,5), (24,6), (21,7), (16,8), (9,9), (0,10))
的載體,我想在對最大的第一要素返回對。 我試過它這樣做:
data reduceLeft[(Int, Int)]((y:(Int, Int),z:(Int,Int))=>y._1 max z._1)
和
data reduceLeft((y:(Int, Int),z:(Int,Int))=>y._1 max z._1)
但類型不匹配的錯誤,我不明白什麼是錯的這個代碼。
可能重複(http://stackoverflow.com/questions/15769366/如何找到的-MAX-IN-A-列表的元組) – lmcphers