title: Find the longest substring in alphabetical order
body: <p>I have this code that I found on another topic, but it sorts the substring by contiguous characters and not by alphabetical order. How do I correct it for alphabetical order? It prints out <code>lk</code>, and I want to print <code>ccl</code>. Thanks</p>
  
  <p>ps: I'm a beginner in python</p>
  
  <pre><code>s = 'cyqfjhcclkbxpbojgkar'
  from itertools import count
  
  def long_alphabet(input_string):
      maxsubstr = input_string[0:0] # empty slice (to accept subclasses of str)
      for start in range(len(input_string)): # O(n)
          for end in count(start + len(maxsubstr) + 1): # O(m)
              substr = input_string[start:end] # O(m)
              if len(set(substr)) != (end - start): # found duplicates or EOS
                  break
              if (ord(max(sorted(substr))) - ord(min(sorted(substr))) + 1) == len(substr):
                  maxsubstr = substr
      return maxsubstr
  
  bla = (long_alphabet(s))
  print "Longest substring in alphabetical order is: %s" %bla
  </code></pre>