Write a function that accepts two parameters, i) a string (containing a list of words) and ii) an integer (n).  The function should alphabetize the list based on the nth letter of each word.

The letters should be compared case-insensitive. If both letters are the same, order them normally (lexicographically), again, case-insensitive.

example:
```javascript 
function sortIt('bid, zag', 2) //=> 'zag, bid'
```
```ruby 
function sortIt('bid, zag', 2) //=> 'zag, bid'
```
```python 
function sortIt('bid, zag', 2) #=> 'zag, bid'
```

The length of all words provided in the list will be >= n.  The format will be "x, x, x". In Haskell you'll get a list of `String`s instead.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Sorting

Data structures

Starter code: def sort_it(list_, n):
	

Solutions:
def sort_it(list_, n):
	return ', '.join(sorted(list_.split(', '), key=lambda i: i[n - 1]))


from operator import itemgetter

def sort_it(list_, n):
	return ', '.join(sorted(list_.split(', '), key=itemgetter(n - 1)))


def sort_it(words, i):
	return ', '.join(sorted(words.split(', '), key=lambda w: w[i - 1]))


def sort_it(a, n):
	return ', '.join(sorted(a.split(', '), key=lambda x: x[n - 1]))


def sort_it(s, n):
	words = s.split(', ')
	return ', '.join((word for word in sorted(words, key=lambda x: x[n - 1])))


def sort_it(list_, n):
	str_list = list_.split(', ')
	str_list.sort(key=lambda f: f[n - 1])
	return ', '.join(str_list)


def sort_it(s, n):
	return ', '.join(sorted(s.split(', '), key=lambda s: s[n - 1]))