#55
Count Occurrences
 

Difficulty:Medium
Topics:seqs core-functions


Write a function which returns a map containing the number of occurences of each distinct item in a sequence.
test not run
(= (__ [1 1 2 3 2 1 1]) {1 4, 2 2, 3 1})
test not run
(= (__ [:b :a :b :a :b]) {:a 2, :b 3})
test not run
(= (__ '([1 2] [1 3] [1 3])) {[1 2] 1, [1 3] 2})
Special Restrictions
  • frequencies


  • Code which fills in the blank: