title: Removing elements in a list given a matrix which references these elements
body: <p>I have both an array and a matrix. Both of them reference the same set of objects, but in different ways.</p>
  
  <p>Say my list contains the elements:</p>
  
  <pre><code>[1,2,3,4,5,6,7,8,9]
  </code></pre>
  
  <p>My matrix would reference the same 9 integers, but like this:</p>
  
  <pre><code>[[3,6,8],
  [2,9,4],
  [5,1,7]]
  </code></pre>
  
  <p>The problem I'm facing is: I need a way to pop edges from the list, given the matrix which points to the same objects that are located in the list. Or, in other words, say I need to remove matrix[1][1], I wish to also be able to remove array[8], but I don't know the index of this object in the list, I only know the object itself and that it is referenced at by some index in the list.</p>