<garvit244>1081_1.py
def smallestSubsequence( text):
    if not text:
        return ''
    import collections
    freq_map = collections.Counter(text)
    used = [False]*26
    result = ''
    
    for char in text:
        freq_map[char] -= 1
        if used[ord(char)-97]:
            continue
        while (result and result[-1] > char and freq_map[result[-1]] > 0):
            used[ord(result[-1])-97] = False
            result = result[:-1]
            
        used[ord(char)-97] = True
        result += char
    return result
def sample_funcname ( var_0 ) :
    if not var_0 :
        return ''
    import var_2
    var_4 = var_2.Counter ( var_0 )
    var_7 = [ False ] * 26
    var_8 = ''
    for var_9 in var_0 :
        var_4 [ var_9 ] -= 1
        if var_7 [ ord ( var_9 ) - 97 ] :
            continue
        while ( var_8 and var_8 [ - 1 ] > var_9 and var_4 [ var_8 [ - 1 ] ] > 0 ) :
            var_7 [ ord ( var_8 [ - 1 ] ) - 97 ] = False
            var_8 = var_8 [ : - 1 ]
        var_7 [ ord ( var_9 ) - 97 ] = True
        var_8 += var_9
    return var_8
