title: count number of duplicates in a list in OCaml
body: <p>I have a list like: </p>
  
  <pre><code>let lst = ["cat"; "dog"; "cow"; "dog"; "cat"; "horse"; "dog"];;
  </code></pre>
  
  <p>I want to count the number of same elements and have the output in a list of tuples (element, count) like:</p>
  
  <pre><code>[("cat", 2); ("dog", 3); ("cow", 1); ("horse", 1)]
  </code></pre>
  
  <p>I tried using <code>List.fold_left</code> but found that the folding function will be complex. Any suggestion?  </p>