title: How to map a list of strings to a list of integers
body: <p>I have a list with n elements:</p>
  <pre><code>['pea', 'rpai', 'rpai', 'schiai', 'pea', 'rpe', 'zoi', 'zoi', 'briai', 'rpe']
  </code></pre>
  <p>I have to assign a number to each string, zero at the start, and then increment by one if the element is different, instead give the same number if the element repeats. Example:</p>
  <pre><code>['pea', 'rpai', 'rpai', 'schiai', 'pea', 'rpe', 'zoi', 'zoi', 'briai', 'rpe']
  [ 0,    1,      1,      2,        0,     3,     4,     4,     5,       3    ]
  </code></pre>
  <p>How can I do it?</p>