Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def subtract(x: Occurrences, y: Occurrences): Occurrences = {
- val sub = y.toMap
- x
- .toMap
- .map((c, i) => (c, i - sub.getOrElse(c, 0)))
- .toList
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement