You will be given a vector of strings. You must sort it alphabetically (case-sensitive, and based on the ASCII values of the chars) and then return the first value.

The returned value must be a string, and have `"***"` between each of its letters.

You should not remove or add elements from/to the array.

Difficulty: introductory

Starter code:

def two_sort(array):
	

Solutions:
def two_sort(lst):
    return '***'.join(min(lst))

def two_sort(array):
    return '***'.join(min(array))

def two_sort(arr):
    return '***'.join(sorted(arr)[0])

def two_sort(a):
    a = sorted(a)
    result = "***".join(a[0])
    return result

def two_sort(array):
    return '***'.join(sorted(array)[0])

def two_sort(a):
    a = sorted(a)
    result = a[0]
    result = result.replace("", "***")
    return result [3:-3]


two_sort = lambda a: "***".join(sorted(a)[0])

two_sort = lambda a: "***".join(min(a))

# o(n) time, o(1) space
def two_sort(words):
  min_word = min(words)
  starred_word = "***".join(list(min_word))
  return starred_word

def two_sort(array):
    final = sorted(array)
    return '***'.join(final[0])

def two_sort(array):
    return "***".join(i for i in sorted(array)[0])

def two_sort(array):
    x = ""
    a = sorted(array)
    for alp in a[0]:
        x = x + alp + "***"
    return x[:-3]

def intersperse(delim, s):
    it = iter(s)
    yield next(it)
    for t in it:
        yield delim
        yield t

def two_sort(array):
    return ''.join(intersperse('***', sorted(array)[0]))

def two_sort(array):
    temp = array.sort()
    new = array[0]
    out = ""
    for i in range(len(new) - 1):
        out += new[i] + "***"
    out += new[-1]
    return (out)

def two_sort(array):
    return '***'.join(list(sorted(array)[0]))

def two_sort(array):
    array.sort()
    first = array[0]
    output_string = ""
    for character in first:
        output_string += character + "***"
    return output_string.strip("***")

def two_sort(array):
    sort = sorted(array)
    first = sort[0]
    return "***".join(first)


def two_sort(array):
    word = sorted(array)[0]
    result = [i for i in word]
    return "***".join(result)
    


def two_sort(array):
    result =""
    word = sorted(array)[0]
    n = 0
    
    while n < len(word):
        if len(word)-n ==1:
            result += word[n]
        else:
            result +=word[n]+"***"
        n+=1
    return result

two_sort = lambda l:'***'.join(sorted(l)[0])

def two_sort(array):
    array.sort()
    a = []
    i = array[0]
    for j in i:
        a.append(j)
    return "***".join(a)

def two_sort(array):
    print(array)
    temp = min(array)
    print(temp)
    res = ""
    for x in temp:
        res += x + "***"
    return res.rstrip("*")

def two_sort(array):
    x=sorted(array)
    word=""
    for i in range(0,len(x[0])):
        word+=x[0][i]
        if i<len(x[0])-1: word+="***"
    return word

def two_sort(array):
    new_arr = sorted(array)
    final_arr = []
    for x in new_arr[0]:
        x += "***"
        final_arr.append(x)
    word = ''.join(final_arr)
    return word.strip("***")



def two_sort(array):
    min=array[0]
    flag=""
    for i in array:
        if i<min:
            min=i
    print(array)
    print(min)
    for i in min:
        index=ord(i.upper())-ord("A")
        flag=flag+i+"***"
        
    return flag[:len(flag)-3]

def two_sort(array):
    s = sorted(array)[0]
    a = ''
    for i in s:
        a +=i+'***'
    return a[:-3]

def two_sort(array):
    arr = [i.split() for i in min(array)]
    return "***".join([i for j in arr for i in j])

def two_sort(array):
    array_1 = sorted(array)
    x = array_1[0]
    l = []
    for i in x:
        l.append(i)
    return '***'.join(l)

def two_sort(a):
    a.sort()
    a = a[0]
    b = ""
    for x in a:
        b = f"{b}{x}***"
    return b[:-3]

def two_sort(array):
    return '***'.join(el for el in sorted(array)[0])

def two_sort(array):
    array.sort()
    return "".join(map(lambda x: x + '***', array[0]))[0:-3]

def two_sort(array):
    array = sorted(array)
    return "***".join(i for i in array[0])

def two_sort(array):
    #for i in range(len(array)):
    #    [i][0]
    list.sort(array)
    car=list(array[0])
    return('***'.join(car))


def two_sort(array):
    array = sorted(array)
    newStr = ''
    for char in array[0]:
        newStr += char+'***'
    return newStr.rstrip('***')

def two_sort(array):
    x = sorted(array)[0]
    return "***".join(c for c in x)

def two_sort(array):
    firstElem = sorted(array)[0]
    returnArr = [] 
    for i in range(len(firstElem)-1): 
        returnArr.append(firstElem[i])
        returnArr.append('***')
    returnArr.append(firstElem[-1])
    return "".join(returnArr)

def two_sort(array):
    word = sorted(array)[0]
    return "***".join(list(word))



def two_sort(array):
    # your code here
    array.sort()
    a=array[0]
    s=""
    for i in a:
        s=s+i+"***"
    l=len(s)
    return s[0:l-3]

def two_sort(array):
    sort_list = sorted(array)
    first_ele = sort_list[0]
    last = '***'.join(first_ele)
    return last


def two_sort(array):
    return "***".join([*sorted(array)[0]])

def two_sort(array):
    a = list(array)
    a.sort()

    res = str(a[0]).strip()
    tmp = ""
    
    for i in range(len(res)):
        tmp += res[i] + "***"*(i < len(res) - 1)
    
    return tmp

def two_sort(array):
    x = sorted(array)
    #print(x)
    a = x[0]
    a1 = "***".join(a)
    return (a1)

def two_sort(array):
    ans = ''
    array.sort()
    for i in array[0]:
            ans = ans + (i + '***')
    return ans[0:-3]


def two_sort(array):
    array = sorted(array)
    a = ""
    for el in array[0]:
        a += el + "***"
    return a[:-3]

def two_sort(array):
    return "***".join((sorted([x for x in array if x[0].isupper()])+sorted([x for x in array if x[0].islower()]))[0])

def two_sort(array):
    sort = sorted(array)
    x = '***'.join(sort[0])
    return x

def two_sort(array):
    array = sorted(array)
    return ('***').join(x[0] for x in array[0])

def two_sort(array):
    return "***".join(sorted([n for n in array])[0])

def two_sort(array):
    array.sort()
    x=array[0]
    s=""
    for i in x:
        s+="***"+i
    return s[3:]


def two_sort(array):
    return '***'.join(sorted(array)[0][i]for i in range(len(sorted(array)[0])))


def two_sort(array):
    res = ''
    for x in sorted(array)[0]:
        res += x + "***"
    return res[:-3]

# You will be given an vector of string(s).
# You must sort it alphabetically (case-sensitive, and based on the ASCII 
# values of the chars) and then return the first value.

# The returned value must be a string, and have "***" between each of its letters.

# You should not remove or add elements from/to the array.


def two_sort(list):
    # your code here
    list.sort()
    y = list[0]
    res = '***'.join(y[i:i + 1] for i in range(0, len(y), 1))
    return res

def two_sort(array):
    array.sort()
    lst = []
    new_str = ''
    for i in array[0]:
        lst.append(i)
    for x in lst:
        new_str = new_str + x + '***'
    return new_str[0:-3]


def two_sort(array):
    return ''.join(i + '***' for i in sorted(array)[0]).rstrip('***')

def two_sort(array):
    out = ""
    for let in sorted(array)[0]:
        out += let + "***"        
    return out.rstrip("***")


two_sort = lambda list: "***".join(min(list))

def two_sort(array):
    array.sort()
    return ("".join(x+"***" for x in array[0])).rstrip("*")

def two_sort(array):
    array.sort()
    result = ""
    for i, caracter in enumerate(array[0]):
        result += array[0][i]
        if i < len(array[0])-1:
            result += "***"
    return result

def two_sort(array):
    
    array.sort()
    
    word = array[0]
    
    new_word = ""
    
    for letter in word:
        new_word+=letter
        new_word+="***";
        
    return new_word[:-3]


def two_sort(array):
    array = sorted(array)
    x = list(array[0])
    return "***".join(x)


import re
def two_sort(array):
    print(array)
    min_value=10000
    min_value2=10000
    min_string=" "
    for x in array:
        if len(x)<2:
            y=ord(x[0])
            min_value=y
            min_string=x
        else:
            y=ord(x[0])
            y2=ord(x[1])
            if y<min_value:
                min_value=y
                min_value2=y2
                min_string=x
            elif y==min_value:
                if y2<min_value2:
                    min_value2=y2
                    min_string=x
                else:
                    continue
            else:
                continue
    return "***".join(min_string)

def two_sort(array):
    array.sort()
    first=array[0]
    final=first[0]
    for i in range(1,len(first)):
        final+='***'+first[i]
    return final

def two_sort(array):
    final = ''
    word = list(sorted(array)[0])
    for i in range(len(word)):
        if i != len(word) - 1:
            final += word[i] + '***'
        else:
            final += word[i]
    
    return final


def two_sort(array):
    '''
    first we sort the array by sort() function :->
    and then we will take its first element and use it to get output :->
    '''
    array.sort()
    return ''.join([i+'***' for i in array[0]])[:-3]



def two_sort(array):
    b=sorted(array)
    return '***'.join(b[0])

def two_sort(array):
    a=''
    for i in range(len(sorted(array)[0])):
        a+=sorted(array)[0][i]+'***'
    return a[:-3]

def two_sort(array):
    # yor code here
    array=sorted(array)
    st=""
    for c in array[0]:
        st+=c+"***"
    return st.rstrip("***")

def two_sort(array):
    array.sort()
    new_arr = []
    for i in array[0]:
        new_arr.append(i)
    return "***".join(new_arr)

def two_sort(array):
    array.sort()
    printer = ""
    for i in array[0]:
        printer += i + "***"
    return printer.rstrip("***")

def two_sort(array):
    x = sorted(array)
    y = x[0]
    return '***'.join(y[i:i + 1] for i in range(0, len(y))) 


def two_sort(array):
    return "".join(sorted(array)[0][i] + "***" for i in range(0,len(sorted(array)[0])))[:-3]
    # your code here


def two_sort(array):
    array.sort()
    a = ""
    for x in range(len(array[0])-1):
        a += array[0][x] + "***"
    return a + array[0][-1]

def two_sort(array):
    return "***".join([j for j in sorted(array)[0]])

def two_sort(array):
    first_item = sorted([i for i in array])[0]
    formatted = ""
    for i in first_item:
        formatted = formatted + i +"***"
    return formatted[:-3]


def two_sort(array):
    str = "".join(sorted(array)[:1])
    return "***".join(list(str))

def two_sort(array):
    x = sorted(array)[0]
    s = x[0]
    for l in range(len(x) - 1) :
        s = s + "***" + x[l + 1]
    return s

def two_sort(array):
    separator = '***'
    return separator.join(sorted(array)[0])


def two_sort(array):
    array = sorted(array)
    emptystring = ''
    for eachletter in array[0]:
        emptystring = emptystring + eachletter + ' '
    emptystring = emptystring.rstrip()
    emptystring = emptystring.split()
    emptystring = '***'.join(emptystring)
    return emptystring

def two_sort(array):
    array_sort = array.sort()
    return ','.join(array[0]).replace(",", "***")

def two_sort(array):
    array = sorted(array)
    answer = ""
    for one in array[0]:
        answer += one + "***"
    return answer.rstrip("*")

def two_sort(array):
    r = ''
    l = sorted(array)
    for i in l[0]:
        r += i + '***'
    return r[:-3]

def two_sort(array):
    return ''.join([x+'***' for x in sorted(array)[0]]).strip('*')

def two_sort(array):
    sorting = sorted(array)
    first = sorting[0]
    new_list = []
    for i in first:
        new_list.append(i)
    return '***'.join(new_list)


def two_sort(array):
    s = ""
    for i in (sorted(array)[0]):
        s += i + "***"
    
    return s[:-3]

def two_sort(array):
    array = list(sorted(array))
    return '***'.join(array[0])


def two_sort(array):
    sort = sorted(array)
    res = ''
    lst = list(sort[0])

    for i in range(len(lst)):
        if i != len(lst) - 1:
            res += lst[i]
            res += '***'
        else:
            res += lst[i]

    return res







def two_sort(array):
    array.sort() 
    listan2 = array[0]
    return ("***".join(listan2))




def two_sort(array):
    s = 'z'
    for i in array:
        if ord(s[0]) > ord(i[0]):
            s = i
        if ord(s[0]) == ord(i[0]):
            if len(i) > 2:
                if ord(s[1]) > ord(i[1]):
                    s = i
    return '***'.join(s)

def two_sort(array):
    return '***'.join([i for i in min(array)])

def two_sort(array):
    array.sort()
    n = ""
    for i in range(0, len(array[0])):
        if i == len(array[0])-1:
            n = n + array[0][i]
            break
        n = n + array[0][i] + "***"
    return n


def two_sort(array):
    # your code here
    array.sort()
    return array[0].replace("", "***").strip("***")

def two_sort(array):
    array.sort()
    return ("".join([(x + "***") for x in array[0]]))[:-3]

def two_sort(array):
    k=[]
    k.append(sorted(array)[0])
    j=[]
    for i in k[0]:
        j.append(i)
        
    return '***'.join(j)

def two_sort(array):
  new_array = array
  new_array.sort()
  first_element = new_array[0]
  result = ""
  for i in range(len(first_element)):
    if i < len(first_element) - 1:
      result += first_element[i] + "***"
    else:
      result += first_element[i]
  return result    


def two_sort(array):
    array.sort()
    return ''.join(f'{e}***' for e in array[0])[:-3]


def two_sort(array):
    f = ''
    for i in sorted(array)[0]:
        f += i + '***'
    return f[:-3]

def two_sort(array):
    array.sort()
    string = array[0]
    return '***'.join(string[i:i + 1] for i in range(0, len(string)))


def two_sort(array):
    array.sort()
    first = array[0]
    first = str(first)
    first = first.replace('', ' ')
    firstsplit = first.split()
    return '***'.join(firstsplit)


def two_sort(array):
    array= sorted(array)
    s= array[0]
    s2=""
    for i in s:
       s2 += i +"***"
    s2=s2.strip("***")
    return s2