Your task is to make a program takes in a sentence (without puncuation), adds all words to a list and returns the sentence as a string which is the positions of the word in the list. Casing should not matter too.


Example
-----

`"Ask not what your COUNTRY can do for you ASK WHAT YOU CAN DO FOR YOUR country"`

becomes

`"01234567802856734"`

Another example
-----

`"the one bumble bee one bumble the bee"`

becomes

`"01231203"`

Source: codewars | Difficulty: EASY
Tags: Data structures

Starter code: def compress(sentence):
	

Solutions:
def compress(sentence):
	ref = []
	for i in sentence.lower().split():
		if i not in ref:
			ref.append(i)
	return ''.join([str(ref.index(n)) for n in sentence.lower().split()])


def compress(sentence):
	memo = {}
	return ''.join(map(str, (memo.setdefault(s, len(memo)) for s in sentence.lower().split())))


def compress(sentence):
	l = sentence.lower().split()
	d = {}
	ans = []
	for x in l:
		if not x in d:
			d[x] = len(d)
		ans += [str(d[x])]
	return ''.join(ans)


def compress(sentence):
	words = sentence.lower().split()
	uniq = sorted(set(words), key=words.index)
	return ''.join((str(uniq.index(word)) for word in words))


def compress(sentence):
	s = sentence.lower().split()
	sl = []
	for x in s:
		if x not in sl:
			sl.append(x)
	return ''.join((str(sl.index(x)) for x in s))


def compress(sentence):
	t = []
	for i in sentence.lower().split(' '):
		if i.lower() not in t:
			t.append(i)
	return ''.join([str(t.index(i.lower())) for i in sentence.split(' ')]) if sentence else ''


def compress(sentence):
	l = sentence.lower().split()
	u = [s for (i, s) in enumerate(l) if l.index(s) == i]
	return ''.join((str(u.index(s)) for s in l))


def compress(s):
	d = {}
	i = 0
	r = ''
	for w in s.lower().split():
		if w not in d:
			d[w] = i
			i += 1
		r += str(d[w])
	return r