title: Determining the minimum of a list of n elements
body: <p>I'm having some trouble developing an algorithm to determine the minimum of a list of n elements. It's not the case of finding the minimum of an array of length n, that's simple:</p>
  
  <pre><code>min = A[0]
  for i in range(1, len(A)):
      if min &gt; A[i]: min = A[i]
  print min
  </code></pre>
  
  <p>But my list contains objects:</p>
  
  <pre><code>class Object:
      def __init__(self, somelist):
          self.classification = somelist[0] # String
          self.type           = somelist[1] # String
          self.first          = somelist[2] # Integer
          self.last           = somelist[3] # Integer
  </code></pre>
  
  <p>And for the same 'classification | type' objects I have m elements and I want to find the minimum element of the same 'classification | type' by comparing the difference between first and last.</p>
  
  <p>Example:</p>
  
  <pre><code>obj1 = Object(['A', 'x', 4, 17])
  obj2 = Object(['A', 'y', 5, 20])
  obj3 = Object(['B', 'z', 10, 27])
  obj4 = Object(['B', 'z', 2, 15])
  obj5 = Object(['B', 'z', 20, 40])
  obj6 = Object(['A', 'x', 6, 10])
  obj7 = Object(['A', 'x', 2, 9])
  list = [obj1, obj2, obj3, obj4, obj5, obj6, obj7]
  </code></pre>
  
  <p>So I need an algorithm to determine the minimums of the list:</p>
  
  <p>A | x --> Object(['A', 'x', 6, 10])</p>
  
  <p>B | z --> Object(['B', 'z', 2, 15])</p>
  
  <p>A | y --> Object(['A', 'y', 5, 20])</p>
  
  <p>Thanks!</p>