title: Sort a list based on a given order
body: <p>I have a list, say <code>A = [[3,5],[1,3],[6,1]]</code>.</p>
  <p>And I have another list, say <code>B = [6,1,3]</code></p>
  <p>I want to sort list <code>A</code> so that <code>A</code> becomes <code>[[6,1],[1,3],[3,5]]</code>, which fits the given <code>B</code> — i.e. the first member of each <code>A</code> sublist should be sorted according to <code>B</code>.</p>