**This Kata is intended as a small challenge for my students**

All Star Code Challenge #19

You work for an ad agency and your boss, Bob, loves a catchy slogan. He's always jumbling together "buzz" words until he gets one he likes. You're looking to impress Boss Bob with a function that can do his job for him.

Create a function called sloganMaker() that accepts an array of string "buzz" words. The function returns an array of all possible UNIQUE string permutations of the buzz words (concatonated and separated by spaces).

Your boss is not very bright, so anticipate him using the same "buzz" word more than once, by accident. The function should ignore these duplicate string inputs.

```
sloganMaker(["super", "hot", "guacamole"]);
//[ 'super hot guacamole',
//  'super guacamole hot',
//  'hot super guacamole',
//  'hot guacamole super',
//  'guacamole super hot',
//  'guacamole hot super' ]

sloganMaker(["cool", "pizza", "cool"]); // => [ 'cool pizza', 'pizza cool' ]
```

Note:  
There should be NO duplicate strings in the output array

The input array MAY contain duplicate strings, which should STILL result in an output array with all unique strings

An empty string is valid input

```if-not:python,crystal
The order of the permutations in the output array does not matter
```
```if:python,crystal
The order of the output array must match those rules:
1. Generate the permutations in lexicographic order of the original array.
2. keep only the first occurence of a permutation, when duplicates are found.
```

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Combinatorics

Data structures

Starter code: def slogan_maker(array):
	

Solutions:
def slogan_maker(array):
	print(array)
	from itertools import permutations
	array = remove_duplicate(array)
	return [' '.join(element) for element in list(permutations(array, len(array)))]

def remove_duplicate(old_list):
	final_list = []
	for num in old_list:
		if num not in final_list:
			final_list.append(num)
	return final_list


from itertools import permutations

def slogan_maker(arr):
	return list(map(' '.join, permutations(dict(list(zip(arr, list(range(len(arr)))))))))


slogan_maker = lambda a: list(map(' '.join, __import__('itertools').permutations(dict.fromkeys(a))))


import itertools, collections

def slogan_maker(array):
	return [' '.join(i) for i in itertools.permutations(collections.OrderedDict.fromkeys(array))]


def slogan_maker(array):
	ls = []
	for i in array:
		if i not in ls:
			ls.append(i)
	if len(ls) == 0:
		return []
	if len(ls) == 1:
		return ls
	l = []
	for i in range(len(ls)):
		e = ls[i]
		re = [i for i in ls if i != e]
		for p in slogan_maker(re):
			l.append(e + ' ' + p)
	return l


from itertools import permutations

def remove_duplicates(list):
	unique = []
	for l in list:
		if l not in unique:
			unique.append(l)
	return unique

def slogan_maker(input):
	input = remove_duplicates(input)
	output = []
	for p in permutations(input, len(input)):
		output.append(' '.join(p))
	return output


import itertools

def slogan_maker(a):
	a2 = list(set(a))
	a2.sort(key=a.index)
	x = []
	result = list(itertools.permutations(a2, len(a2)))
	for i in range(0, len(result)):
		x.append(join1(result[i]))
		i += 1
	return x

def join1(x):
	x1 = list(x)
	return ' '.join(x1)


from itertools import permutations

def slogan_maker(array):
	array = [e for (index, e) in enumerate(array) if array.index(e) == index]
	buzz_words = permutations(array, len(array))
	return [' '.join(buzz) for buzz in buzz_words]


import itertools

def slogan_maker(tab):
	tab_set = set()
	unique = [x for x in tab if x not in tab_set and (tab_set.add(x) or True)]
	generator = [] * len(unique)
	x = list(itertools.permutations(unique))
	for i in x:
		generator.append(' '.join(i))
	return generator


from collections import Counter
from itertools import permutations

def slogan_maker(array):
	slogan = [i for i in list(Counter(array).keys())]
	res = []
	for i in permutations(slogan, len(slogan)):
		res.append(' '.join(i))
	return res