Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My:
- object Scoring {
- def high(s: String) = {
- s.split(" ").map(w => (w, w.map(_.toInt - 96).sum)).maxBy(_._2)._1
- }
- }
- Other:
- object Scoring {
- def high(s: String): String =
- s.split(' ').maxBy(_.map(_ - 96).sum)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement