title: How to sum the iterative max's found in a list without it colliding with other previous max's less than two index away?
body: <p>For example if the list is:</p>
  <pre><code>a_list = [1,3,8,2,3,6]
  </code></pre>
  <p>The algorithm would go something like this:</p>
  <ul>
  <li>Collect only the highest numbers</li>
  <li>So start with 8</li>
  <li>Second highest 6 (check condition, it is true, being two spaces ahead of 8)</li>
  <li>Third highest 3 (check condition, false, it is right next to 8)</li>
  <li>Third highest again 3 (check condition, right next to 6, false)</li>
  <li>Third highest again 2 (right next to 8, false)</li>
  <li>Third highest again 1 (condition kept, true, add)</li>
  </ul>
  <p>Then this list would be summed at the end.</p>
  <pre><code>8 + 6 + 1 = 15
  </code></pre>
  <p>I would want to optimize this to make it as fast as possible. Perhaps this isn't the fastest algo for this?</p>
  <p>Any help is welcomed.
  Thank you</p>