title: Replace words in a text with index of first occurrence
body: <p>I have to create a program that can take a sentence such as </p>
  
  <pre><code>my arms are red, my legs are red and I am red
  </code></pre>
  
  <p>and output the sentence with the indices of the first occurrence of the word in the sentence, so the desired output of that sentence would be</p>
  
  <pre><code>12341634910114 
  </code></pre>
  
  <p>I have no idea how I would do this.</p>
  
  <p>Thanks</p>