title: Finding duplicates in list and operating only on one of them
body: <p>I expanded and added as a new question.</p>
  
  <p>I have a list:</p>
  
  <pre><code>li = [2, 3, 1, 4, 2, 2, 2, 3, 1, 3, 2] 
  </code></pre>
  
  <p>Then I recognize which value occurs most often, which value I retain in the variable <code>i2</code>:</p>
  
  <pre><code>f = {}
  for item in li:
      f[item] = f.get(item, 0) + 1   
  
  for i in f:
      if f[i]==int(max(f.values())):
         i2 = i
  </code></pre>
  
  <p>Later all values that repeat are increased by 10, but in addition to the maximum values. This is the code that I use:</p>
  
  <pre><code>for i in range(len(li)):
      for x in range(i + 1, len(li)):
          if li[i] == li[x] and li[i] != i2:
             li[x] = li[x] + 10
  </code></pre>
  
  <p>After this operation I get:</p>
  
  <pre><code>li = [2, 3, 1, 4, 2, 2, 2, 13, 11, 23, 2]
  </code></pre>
  
  <p>As you can see, the most common value is 2, so it remains unchanged. For example, 3 occurs three times and from all three new values are created 3, 3 + 10, 3 + 20. And the same with the rest of the value (except 2).
  But if the two maximum values are next to each other (or in a longer sequence), I would like to increase each subsequent in such a sequence one by 10, and get:</p>
  
  <pre><code>li = [2, 3, 1, 4, 2, 12, 22, 13, 11, 23, 2] 
  </code></pre>
  
  <p>How to do it?
  I could now do the same on a new loop, but already on the changed list and applying the condition <code>li[i] == li[i+1]</code>, but maybe it can be done in the current loop?</p>