title: check last n elements are equal in numpy array python
body: <p>I have a numpy array with numbers, and I want to count how many elements are equal starting from the last element.</p>
  
  <pre><code>A = [1, 3, 2, 2, 0, 3, 2, 2, 2, 2]
  </code></pre>
  
  <p>then I want the return value to be 4 (last four elements are equal)</p>