Isolating two indexes in a list and summing up one of the indexes with the same indexes as the other?
<p>I have a text file with the content</p>

<pre><code>[100,123,111]
[010,789,222]
[001,123,222]
[230,789,234]
</code></pre>

<p>I want the sum of the numbers at index 2 which share the same number at index 1. For the above example, the expected output is</p>

<pre><code>[333,456]
</code></pre>

<p>because 111 + 222 = 333 (shared number at index 1: 123) and because 222 + 234 = 456.</p>