author | Christian Urban <christian.urban@kcl.ac.uk> |
Mon, 08 Nov 2021 02:16:33 +0000 | |
changeset 409 | 0e55b6313adc |
parent 382 | 1bd800376e0c |
permissions | -rw-r--r-- |
227 | 1 |
|
283 | 2 |
import CW7a._ |
227 | 3 |
|
4 |
assert(occurrences(List("a", "b", "b", "c", "d")) == Map("a" -> 1, "b" -> 2, "c" -> 1, "d" -> 1)) |
|
5 |
||
6 |
assert(occurrences(List("d", "b", "d", "b", "d")) == Map("d" -> 3, "b" -> 2)) |
|
323 | 7 |
|
8 |
assert(occurrences(List("b", "b", "b", "b", "b")) == Map("b" -> 5)) |
|
9 |
||
10 |
assert(occurrences(Nil) == Map()) |