15 August 2017

List Beautifier

My solution:
def listBeautifier(a):
    res = a[:]
    while res and res[0] != res[-1]:
       b, *res, c = res
    return res

Previous