def unique(S, start, stop):
    """Return True if there are no duplicate elements in slice S[start: stop]"""
    print("start = {}, stop = {}".format(start, stop))
    if stop - start <= 1:                                                              # at most 1 item
        return True                  
    elif not unique(S, start, stop-1):                                                 # first part has duplicate
        print("checking uniqueness in (S, {}, {})".format(start, stop-1))                
        return False    
    elif not unique(S, start+1, stop):                                                 # second part has duplicate
         print("checking uniqueness in (S, {}, {})".format(start+1, stop))   
         return False     
    else:
        print("Check uniqueness of 1st and last element for start = {} and stop = {}"
        .format(start, stop))                                                          # do first and last differ
        return S[start] != S[stop]                                                     # do first and last differ