Given 2 strings, `a` and `b`, return a string of the form short+long+short, with the shorter string on the outside
and the longer string on the inside. The strings will not be the same length, but they may be empty ( length `0` ).

For example:

```python
solution("1", "22") # returns "1221"
solution("22", "1") # returns "1221"
```

Difficulty: introductory

Starter code:

def solution(a, b):
	

Solutions:
def solution(a, b):
    return a+b+a if len(a)<len(b) else b+a+b


def solution(a, b):
    return '{0}{1}{0}'.format(*sorted((a, b), key=len))

def solution(a, b):
    if len(a)>len(b):
        return(b+a+b)
    else:
        return(a+b+a)
  


def solution(a, b):
    short, int = sorted((a, b), key=len)
    return short + int + short


solution = lambda a, b: "{0}{1}{0}".format(min(a, b, key = len), max(a, b, key = len))


def solution(a, b):
    return "{0}{1}{0}".format(*(a, b) if len(a) < len(b) else (b, a))
    


def solution(a, b):
    if len(a) > len(b):
        return f'{b}{a}{b}'
    else:
        return f'{a}{b}{a}'


def solution(a, b):
    if len(str(a)) < len(str(b)):
        return '{}{}{}'.format(a,b,a)
    else:
        return '{}{}{}'.format(b,a,b)


solution = lambda a,b: a*(len(a)<len(b))+b+a+b*(len(a)>len(b))

def solution(a, b):
    a,b = sorted([a,b], key=len)
    return a + b + a


def solution(a, b):
    res = []
    if len(a) > len(b):
        res.append(b)
        res.append(a)
        res.append(b)
    else:
        res.append(a)
        res.append(b)
        res.append(a)        
    return "".join(res)


def solution(a: str, b: str) -> str:
    short, int = sorted((a, b), key=len)
    return f"{short}{long}{short}"


def solution(a, b):
    shortest_string = None
    longest_string = None
    if min(len(a), len(b)) == len(a):
        shortest_string = a
        longest_string = b
    else:
        shortest_string = b
        longest_string = a
    return shortest_string + longest_string + shortest_string

# find len of str
# if len a > len b
# do bab
# else do aba
def solution(a, b):
    p = len(a)
    w = len(b)
    if p > w:
        l = b + a + b
        return l
    else:
        m = a + b + a
        return m


def solution(a, b):
    if a and b .isnumeric():
        return b + a + b if a > b else a + b + a
    else:
        return b + a + b if len(a) > len(b) else a + b + a

def solution(a, b):
    return a+b+a if len(b) > len(a) else b+a+b 


solution=lambda a,b:b+a+b if len(a)>len(b)else a+b+a

solution=lambda a,b:(a+b+a,b+a+b)[len(a)>len(b)]

'''
'''
def solution(a, b):
    combined_string = ''
    if len(a) > len(b):
        combined_string = b+a+b
        return combined_string
    else:
        combined_string = a+b+a
        return combined_string


def solution(a, b):
    return f'{b}{a}{b}' if len(a) > len(b) else f'{a}{b}{a}'

def solution(a='', b=''):
    if len(a)>len(b):
        return b+a+b
    else:
        return a+b+a


a_len = 0
b_len = 0

def solution(a, b):
    a_len = len(a)
    b_len = len(b)
    if a_len < b_len:
        return a + b + a
    else: return b + a + b

def solution(a: str, b: str) -> str:
    if len(a) < len(b):
        return a + b + a
    return b + a + b


def solution(a, b):
    
    if len(a) > len(b):
        d = a
        c = b
    else:
        d = b
        c = a
    return f"{c}{d}{c}"


def solution(a, b):
    string = ''
    if len(a)>len(b):
        string = b + a + b
    else:
        string = a + b + a
    return string

def solution(a, b):
    if len(a) < len(b):
        list = a, b, a
    else:
        list = b, a, b
    return "".join(list)


def solution(a, b):
    if a.isdigit() and b.isdigit():
        return b+a+b if a > b else a+b+a
    else:
        return b+a+b if len(a) > len(b) else a+b+a
        


def solution(a, b):
    try:
        if int(a) < int(b):
            return a + b + a
        else:
            return b + a + b 
    except: 
        if len(a) < len(b):
            return a + b + a
        else:
            return b + a + b 
        


def solution(a, b):
    l = []
    l.append(a), l.append(b)
    l.sort(key=lambda x: len(x))
    res = lambda x: f"{x[0]}{x[1]}{x[0]}"
    return res(l)


def solution(a, b):
    
    x=len(a)
    y=len(b)
    
    if x>=y:
        return b+a+b
    else:
        return a+b+a
    
    


def solution(a, b):
    if a is None and b is None: return a
    elif b is None: return a
    elif a is None: return b
    else: 
        a_len = len(a)
        b_len = len(b)
        if a_len >= b_len:
            return b + a + b
        else:
            return a + b + a

def solution(a, b):
    if type(a) == int:
        
        if a < b:
            return a + b + a
        elif a > b:
            return b + a + b
        
    if type(a) == str:
        
        if len(a) < len(b):
            return a + b + a
        elif len(a) > len(b):
            return b + a + b
    
        


def solution (a, b):
    return ''.join(a + b + a if len(a) < len(b) else b + a + b)

#def solution(a, b):
#    return ''.join(a + b + a if len(a) < len(b) else b + a + b)


def solution(a, b):
    if len(a) < len(b):
        return a+b+a
    elif len(a) > len(b):
        return b+a+b
    else:
        return None

def solution(a, b):
    if (len(a) > len(b)):
        return f"{b + a + b}"
    else:
        return f"{a + b + a}"
    


def solution(a, b):

    if len(a) > len(b):
        return b + a + b
    elif len(a) < len(b):
        return a + b + a
print((solution("123", "34")))


def solution(a='', b=''):
    return f'{a}{b}{a}' if len(b) > len(a) else f'{b}{a}{b}'
    


# checks if string a or b is longer
# returns string short_string+long_string+short_string
def solution(a, b):
    return a+b+a if len(a)<=len(b) else b+a+b

def solution(a, b):
    arr_sorted = sorted([a, b], key=len)
    return "".join([arr_sorted[0], arr_sorted[1], arr_sorted[0]])


def solution(a, b):
    if(len(a)>len(b)):
        c=(b,a,b)
        return ("".join(c))
    c=(a,b,a)
    return ("".join(c))

def solution(a, b):
    alen = len(a)
    blen = len(b)
    c=[]
    if alen < blen:
        c.append(a)
        c.append(b)
        c.append(a)
    elif blen < alen:
        c.append(b)
        c.append(a)
        c.append(b)
    c = "".join(c)
    return c


def solution(a, b):
    shortest, longest = (a, b) if len(a) < len(b) else (b, a)
    return shortest + longest + shortest


def solution(a, b):
    if (len(a)<len(b)):
        new_string=a+b+a
    else:
        new_string=b+a+b
    return new_string


def solution(a, b):
    zA =[]
    for iA in a:
        zA.append (len(iA))
    zB =[]
    for iB in b:
        zB.append (len(iB))
    if zA < zB:
        return f"{a+b+a}"
    else:
        return f"{b+a+b}"        



def solution(a, b):
    short, int = '',''
    if len(a) > len(b):
        long = a
        short = b
    else:
        short = a
        long = b
    
    return short+int+short


def solution(a, b):
    if(len(a) < len(b)):
        result=a+b+a
        return result
    else:
        result=b+a+b
        return result
    


def solution(a, b):
    a1 = len(a)
    b1 = len(b)

    if a1 > b1:
        return b + a + b
    else:
        return a + b + a

def solution(a, b):
    if len(a)>len(b):
        result=b+a+b
    elif len(b)>len(a):
        result=a+b+a
    else:
        result=""
    return result


def solution(a, b):
    la = len(a)
    lb = len(b)
    shrt = a
    lng = b
    if la>lb:
        shrt = b
        lng = a
    return shrt+lng+shrt


def solution(a, b):
    '''determine which string, (a or b) is longer and printing the, short, long, short'''
    if len(a) > len(b):
        return b + a + b
    else:
        return a + b + a

def solution(*s):
    s = sorted(s, key=lambda x: len(x))
    return s[0] + s[1] + s[0]

def solution(a, b):
    newString = ''
    if len(a) < len(b):
        return (newString + a + b + a)
    else: 
        return (newString + b + a + b)

def solution(a, b):
    res = ''
    if len(a)>len(b):
        res = b+a+b
    else:
        res = a+b+a
    return res
        
    
    #if a!=b:
        #return min(a,b)+ max(a,b)+ min(a,b)


def solution(a, b):
    result = ""
    if len(a) < len(b):
        result = a + b + a
    else:
        result = b + a + b
    return result
    pass


def solution(a, b):
    if len(a) > len (b):
        sumar=(b + a + b)
    else:
        sumar=(a + b + a)        
    return sumar



def solution(a, b):
    try:
        x = int(a, b)
    except:
        return a+b+a if len(b) > len(a) else b+a+b
    else:
        return a+b+a if b > a else b+a+b



def solution(a, b):
    return '{0}{1}{0}'.format(a if len(a) < len(b) else b, a if len(a) > len(b) else b)


def solution(a, b) -> str:
    if len(a) <= len(b):
        mini, maxi = a, b
    elif len(a) > len(b):
        maxi, mini = a, b
    return f"{mini}{maxi}{mini}"

def solution(a, b):
    if len(a) > len(b):
        return str(b) + str(a) + str(b)
    elif len(a) < len(b):
        return str(a) + str(b) + str(a)
    else:
        return 'Error'


def solution(a, b):
    k = ''
    if len(a) < len(b):
        k = ''.join(a) + ''.join(b) + ''.join(a)
    else:
        k = ''.join(b) + ''.join(a) + ''.join(b)
    return k


def solution(a, b):
    lena = len(a)
    lenb = len(b)
    if lena > lenb:
        long = a
        short = b
    elif lena < lenb:
        long = b
        short = a
    answer = short + int + short
    return answer

    


def solution(a, b):
    if(len(a)>len(b)):
        return b + a + b
    elif(len(a) < len(b)):
        return a + b + a
    else:
        return -1


def solution(a, b):
    return '' + a + b + a if len(a) < len(b) else '' + b + a + b


def solution(a, b):
    c = []
    if len(a)>len(b):
        c.extend(b)
        c.extend(a)
        c.extend(b)
        return (''.join(c))
    if len(b)>len(a):
        c.extend(a)
        c.extend(b)
        c.extend(a)
        return (''.join(c))
        
    pass


solution = lambda a, b: f'{a}{b}{a}' if len(b) > len(a) else f'{b}{a}{b}'


def solution(a = '', b = ''):
    if len(a) > len(b):
        return f"{b}{a}{b}"
    elif len(a) < len(b):
        return f"{a}{b}{a}"


def solution(a, b):
    if int(len(a))>int(len(b)):
        return b+a+b
    else:
        return a+b+a


def solution(a, b): 
    if len(a) > len(b):
        short_long = b+a+b
    else:
        short_long = a+b+a
    return short_long


def solution(a, b):
    short = b if len(a) > len(b) else a
    long = a if len(a) > len(b) else b
    
    return f"{short}{long}{short}"

def solution(a, b):
    if len(a) > len(b):
        return str(f'{b}{a}{b}')
    else:
        return str(f'{a}{b}{a}')

def solution(a, b):
    short = ""
    long = ""
    if len(a) > len(b):
        long = a
        short = b
    else:
        long = b
        short = a
    
    return short + int + short


def solution(a, b):
    if (len(a)) <= (len(b)):
        return '{a}{b}{a}'.format(a=a, b=b)
    elif (len(a)) >= (len(b)):
        return '{b}{a}{b}'.format(a=a, b=b)

    


def solution(a='', b=''):
    return b+a+b if len(a) > len(b) else a + b + a


def solution(a, b):
    n1,n2=len(a),len(b)
    if n1<n2:
        return a+b+a
    else:
        return b+a+b


def solution(a, b):
    string = ""
    if len(a) > len(b):
        string += b
        string += a
        string += b
    else:
        string += a
        string += b
        string += a
    return string 
        


def solution(a, b):
    A_length= len(a)
    B_length= len(b)
    if A_length<=B_length:
        return a + b+ a
    else :
        return b + a + b

def solution(a, b):
    if len(a) > len(b):
        return f"{b}{a}{b}"
    if len(a) < len(b): 
        return f"{a}{b}{a}"


def solution(a, b):
    if len(a) > len(b):
        return ''.join([b,a,b])
    elif len(b) > len(a):
        return ''.join([a,b,a])
    else:
        return None


def solution(a, b):
    return a+b+a if len(a+b+a) < len(b+a+b) else b+a+b

def solution(a, b):
    if len(a) > len(b):
        return "{0}{1}{0}".format(b,a)
    else:
        return "{0}{1}{0}".format(a,b)
        


def solution(a, b):
    if len(a) >= len(b):
        return b+a+b
    return a+b+a

def solution(a,
             b):

    if (len(a) < len(b)):

        return a + b + a

    else:

        return b + a + b


def solution(a, b):
    lsta=[]
    lstb=[]
    if a and b == int:
        if a < b:
            return a+b+a
        else:
            return b+a+b
    else:
        for x in a:
            lsta.append(x)
        for y in b:
            lstb.append(y)
        if len(lsta) < len(lstb):
            r1 = "".join(lsta)
            r2 = "".join(lstb)
            return r1+r2+r1
        else:
            r1 = "".join(lsta)
            r2 = "".join(lstb)
            return r2+r1+r2

def solution(a, b):
    print((len(a)))

    if len(a) > len(b):
        answer = b + a + b
        return answer
    else:
        answer = a + b + a
        return answer


def solution(a, b):
    return "%s%s%s"%(a,b,a) if len(a)<len(b) else "%s%s%s"%(b,a,b)


def solution(a, b):
    la, lb = len(a), len(b)
    return f"{(a, b)[lb<la]}{(a, b)[lb>la]}{(a, b)[lb<la]}"


def solution(a, b):
    if len(a) < len(b):
        short_str = a
        long_str = b
    else:
        short_str = b
        long_str = a
    
    return short_str + long_str + short_str


def solution(a, b):
    if len(a) > len(b):
        x = b + a + b
    else: 
        x = a + b + a
    return x


def solution(a, b):
    along = len(a)
    blong = len(b)
    return a + b + a if along < blong else b + a + b

def solution(a, b):
    if len(a) < len(b):
        return a + b + a
    elif len(a) >= len(b):
        return b + a + b
    


def solution(a, b):
    if len(a) > len(b):
        return b+a+b
    elif len(a) < len(b):
        return a+b+a
    return 0

def solution(a, b):
    k = sorted([a, b], key=len)
    print(k)
    g = k[0]+k[1]+k[0]
    return g


def solution(a, b):
    if len(a) > len(b):
        return "".join(b + a + b)
    elif len(a) < len(b):
        return "".join(a + b + a)


def solution(a, b):
    if len(a)>len(b):
        s = b+a+b
    elif len(a)<len(b):
        s = a+b+a
    return s


def solution(a="", b=""):
    if len(a)<len(b):
        return a + b + a
    else:
        return b + a + b


def solution(a, b):
    s, l = sorted([a, b], key = len)
    return '{}{}{}'.format(s, l, s)


def solution(a, b):
    long = a if len(a) > len(b) else b
    short = a if int != a else b
    return short+int+short


def solution(a, b):
    ab = ""
    if len(a)<len(b):
        ab = a + b + a
    else :
        ab = b + a + b
    return ab


solution = lambda *a: "{0}{1}{0}".format(*sorted(a, key=len))

def solution(a, b):
    new_str = ''
    if(len(a) < len(b)):
        new_str += a + b + a
    else:
        new_str += b + a + b
    return new_str