title: Remove items (sublists) from nested list based on comparison of their elements
body: <p>first post here, so I hope I 'm not duplicating any questions (I checked, though).</p>
  
  <p>Here's the deal:</p>
  
  <p>I have a list, containing 4 element sublists, e.g. <code>[[10,1,3,6],[22,3,5,7],[2,1,4,7],[44,3,1,0]]</code></p>
  
  <p>What I want to do is:</p>
  
  <p>1) Remove all elements having a fourth subelement equal to zero e.g <code>[44,3,1,0]</code> (the easy part)</p>
  
  <p>2) Remove items that have the same second element,keeping only the ones with the largest first element e.g. <code>[[10,1,3,6],[2,1,4,7]] -&gt; [10,1,3,6]</code></p>
  
  <p>I've been trying to come to a solution using nested loops and a second list to take the elements I want to keep, but I can't seem to be able to nail it.</p>
  
  <p>Is there an elegant solution I could use?</p>