https://numbas.mathcentre.ac.uk/question/77819/count-the-number-of-occurrences-frequencies-of-each-distinct-element-in-a-list/embed/