title: Need to find lowest differences between first line of an array and the rest ones
body: <p>Well, I've been given a number of pairs of elements <code>(s,h)</code>, where <code>s</code> sends an <code>h</code> element on the <code>s</code>-th row of a 2d array.It is not necessary that each line has the same amount of elements, only known that there cannot be more than N elements on a line.</p>
  
  <p>What I want to do is to find the lowest biggest difference(!) between a certain element of the first line and the rest ones.</p>
  
  <p>Thus, if I have 3 lines with <code>(101,92) (100,25,95,52,101) (93,108,0,65,200)</code> what I want to find is 3, because I have to choose 92 and I have 95-92=3 from first to second and 93-92=1 form first to third.</p>
  
  <p>I have reached a point where it is certain that if I have <code>s</code> lines with <code>n(i)</code> elements each and <code>i=0..s</code>, then <code>n0&lt;=n1&lt;=...&lt;=ns</code> so as to have a good average performance scenario when picking the best-fit from 1st line towards the others.</p>
  
  <p>However, I cannot think of a way lower than O(n<sup>2</sup>) or even maybe O(n<sup>3</sup>) in some cases. Does anyone have a suggestion about a fairly improved way to do this?</p>