title: Sorting a list using an alphabet string
body: <p>I'm trying to sort a list containing only lower case letters by using the string :</p>
  
  <pre><code>alphabet = "abcdefghijklmnopqrstuvwxyz". 
  </code></pre>
  
  <p>that is without using sort, and with O(n) complexity only. 
  I got here: </p>
  
  <pre><code>def sort_char_list(lst):
  alphabet = "abcdefghijklmnopqrstuvwxyz"
  new_list = []
  length = len(lst)
  
  for i in range(length):
      new_list.insert(alphabet.index(lst[i]),lst[i])
      print (new_list)
  
  return new_list
  </code></pre>
  
  <p>for this input : </p>
  
  <pre><code>m = list("emabrgtjh")
  </code></pre>
  
  <p>I get this: </p>
  
  <pre><code>['e']
  ['e', 'm']
  ['a', 'e', 'm']
  ['a', 'b', 'e', 'm']
  ['a', 'b', 'e', 'm', 'r']
  ['a', 'b', 'e', 'm', 'r', 'g']
  ['a', 'b', 'e', 'm', 'r', 'g', 't']
  ['a', 'b', 'e', 'm', 'r', 'g', 't', 'j']
  ['a', 'b', 'e', 'm', 'r', 'g', 't', 'h', 'j']
  ['a', 'b', 'e', 'm', 'r', 'g', 't', 'h', 'j']
  </code></pre>
  
  <p>looks like something goes wrong along the way, and I can't seem to understand why.. if anyone can please enlighten me that would be great. </p>