News for hackers. Stuff that matters.
Re:Nth-to-Last Element in a Singly Linked List by bshep on Sunday January 31, 2010 @10:44PM (#1091726)
Quick and Dirty(probably better ways to do it):

  def permute(string, prefix = ''):
        if len(string) == 1:
  		print prefix + string
  		return
  
        for x in range(0, len(string)):
  		new_prefix = prefix + string[x]
  		unused_chars = string[0:x] + string[x+1:]
  		permute(unused_chars, new_prefix)

There are no comments on this comment yet.