title: Find index of last occurrence of a substring in a string
body: <p>I want to find the position (or index) of the last occurrence of a certain substring in given input string <code>str</code>.</p>
  
  <p>For example, suppose the input string is <code>str = 'hello'</code> and the substring is <code>target = 'l'</code>, then it should output 3.</p>
  
  <p>How can I do this?</p>