You probably know the "like" system from Facebook and other pages. People can "like" blog posts, pictures or other items. We want to create the text that should be displayed next to such an item.

Implement a function `likes :: [String] -> String`, which must take in input array, containing the names of people who like an item. It must return the display text as shown in the examples:

```python
likes([]) # must be "no one likes this"
likes(["Peter"]) # must be "Peter likes this"
likes(["Jacob", "Alex"]) # must be "Jacob and Alex like this"
likes(["Max", "John", "Mark"]) # must be "Max, John and Mark like this"
likes(["Alex", "Jacob", "Mark", "Max"]) # must be "Alex, Jacob and 2 others like this"
```

For 4 or more names, the number in `and 2 others` simply increases.

Difficulty: introductory

Starter code:

def likes(names):
	

Solutions:
def likes(names):
    n = len(names)
    return {
        0: 'no one likes this',
        1: '{} likes this', 
        2: '{} and {} like this', 
        3: '{}, {} and {} like this', 
        4: '{}, {} and {others} others like this'
    }[min(4, n)].format(*names[:3], others=n-2)

def likes(names):
    if len(names) == 0:
        return "no one likes this"
    elif len(names) == 1:
        return "%s likes this" % names[0]
    elif len(names) == 2:
        return "%s and %s like this" % (names[0], names[1])
    elif len(names) == 3:
        return "%s, %s and %s like this" % (names[0], names[1], names[2])
    else:
        return "%s, %s and %s others like this" % (names[0], names[1], len(names)-2)

def likes(names):
    # make a dictionary d of all the possible answers. Keys are the respective number
    # of people who liked it.
    
    # {} indicate placeholders. They do not need any numbers but are simply replaced/formatted
    # in the order the arguments in names are given to format
    # {others} can be replaced by its name; below the argument "others = length - 2"
    # is passed to str.format()
    d = {
        0: "no one likes this",
        1: "{} likes this",
        2: "{} and {} like this",
        3: "{}, {} and {} like this",
        4: "{}, {} and {others} others like this"
        }
    length = len(names)
    # d[min(4, length)] insures that the appropriate string is called from the dictionary
    # and subsequently returned. Min is necessary as len(names) may be > 4
    
    # The * in *names ensures that the list names is blown up and that format is called
    # as if each item in names was passed to format individually, i. e.
    # format(names[0], names[1], .... , names[n], others = length - 2
    return d[min(4, length)].format(*names, others = length - 2)


def likes(names):
    formats = {
            0: "no one likes this",
            1: "{} likes this",
            2: "{} and {} like this",
            3: "{}, {} and {} like this",
            4: "{}, {} and {others} others like this"
        }
    n = len(names)
    return formats[min(n,4)].format(*names, others=n-2)


def likes(names):
    if len(names) == 0:
        return 'no one likes this'
    elif len(names) == 1:
        return str(names[0]+' likes this')
    elif len(names) == 2:
        return str(names[0]+' and '+names[1]+' like this')
    elif len(names) == 3:
        return str(names[0]+', '+names[1]+' and '+names[2]+' like this')
    else:
        return str(names[0]+', '+names[1]+' and '+str(len(names)-2)+' others like this')

def likes(names):
    """Convert list of names into strings of likes

    Args:
        names (list): List of string names

    Returns:
        str

    Examples:
        >>> likes(['Pavel', 'Yury', 'Sveta'])
        'Pavel, Yury and Sveta like this'
    """
    if not names:
        return 'no one likes this'
    if len(names) == 1:
        first = ''
        second = names[0]
    elif len(names) == 2:
        first = names[0]
        second = names[1]
    elif len(names) == 3:
        first = ', '.join(names[:2])
        second = names[-1]
    else:
        first = ', '.join(names[:2])
        second = '%d others' % (len(names) - 2)
    if first:
        return first + ' and ' + second + ' like this'
    else:
        return second + ' likes this'

def likes(names):
    l = len(names)
    if l == 0: return 'no one likes this'
    if l == 1: return '{} likes this'.format(names[0])
    if l == 2: return '{} and {} like this'.format(names[0], names[1])
    if l == 3: return '{}, {} and {} like this'.format(names[0], names[1], names[2])
    return '{}, {} and {} others like this'.format(names[0], names[1], len(names)-2)



def likes(names):
    output = {
        0 : "no one likes this",
        1 : "{} likes this",
        2 : "{} and {} like this",
        3 : "{}, {} and {} like this",
        4 : "{}, {} and {others} others like this",
    }
    
    count = len(names)
    
    return output[min(4,count)].format(*names[:3], others=count-2)

def likes(names):
    if not names:
        return "no one likes this"
    size = len(names)
    if size == 1:
        return "%s likes this" % names[0]
    if size == 2:
        return "%s and %s like this" % (names[0], names[1])
    if size == 3:
        return "%s, %s and %s like this" % (names[0], names[1], names[2])
    if size >= 4:
        return "%s, %s and %s others like this" % (names[0], names[1], len(names[2:]))

def likes(names):
    l = len(names)
    s = 'no one likes this'
    
    if l == 1:
        s = names[0] + ' likes this'
    elif l == 2:
        s = ' and '.join(names) + ' like this'
    elif l == 3:
        s = ', '.join(names[:-1]) + ' and ' + names[-1] + ' like this'
    elif l != 0:
        s = ', '.join(names[:2]) + ' and ' + str(l - 2) + ' others like this'
    
    return s