News for hackers. Stuff that matters.
Re:Python Multiple Assignment Is a Puzzle by kghose on Sunday July 27, 2014 @08:55AM (#8092613)

  A = [1, 2, 4, 5, 7]
  A_s = sorted(A)
  b = A_s[0]
  for a in A_s[1:]:
    if a - b > 1:
      print b + 1
      break
    else:
      b = a
  else:
    print 'No missing element'
Trying to be more Pythonic:

  def test(l):
    l_s = sorted(l)
    print [l0 + 1 for l1, l0 in zip(l_s[1:], l_s[:-1]) if l1 - l0 > 1]
Re:Python Multiple Assignment Is a Puzzle by ericfrederich on Monday July 28, 2014 @10:14AM (#8096786)
Sorting is not O(N), at best it is O(NlogN)
Re:Python Multiple Assignment Is a Puzzle by abhinavk on Sunday July 27, 2014 @08:33PM (#8094501)
But the code is not competitive.