Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case class MT(category: String, time: Long)
- val ml = List(MT("PM", 2),MT("PM", 1),MT("PM", 1))
- ml groupBy (_.category) map { case (k, v) => k -> (v map (_.time) sum) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement