title: Sort Array of Arrays by length with tiebreaker
body: <p>I have an <code>Array</code> of <code>Array</code>s that I want to sort by longest length to shortest.  I achieved this easily enough with a <code>sort_by</code></p>
  
  <pre><code>&gt; a =  [ [1, 2, 9],
           [4, 5, 6, 7],
           [1, 2, 3] ]
  &gt; a.sort_by(&amp;:length).reverse # or a.sort_by {|e| e.length}.reverse
  =&gt; [[4, 5, 6, 7], [1, 2, 3], [1, 2, 9]]
  </code></pre>
  
  <p>What I want, however is to have a sort of tie-breaker for lists of equal length.  If two lists' lengths are equal, the list whose <strong>last entry is greater</strong> should come first.    So in the above, <code>[1, 2, 9]</code> and <code>[1, 2, 3]</code> should be switched.</p>
  
  <p>I don't care abouth the case where two lists have both equal length and equal last element, they can be in whatever order if that occurs.  I don't know if/how I can acheive this with ruby built-in sorting.</p>