Added solution to problem 24: 'Lexicographic permutations' in Python