class Solution(object):
    def removeDuplicateLetters(self, s):
        """
        :type s: str
        :rtype: str
        """
        for c in sorted(set(s)):
        	suffix = s[ s.index(c) :  ]
        	if set( suffix ) == set(s):
        		return c + self.removeDuplicateLetters(suffix.replace(c, ''))
        return ''



s = "cbacdcbc"

sl = Solution()
print( sl.removeDuplicateLetters( s ) )
3e6a304cd9b34fb41e23af8794f8383f26ed2701
class Solution(object):
    <mask token>


<mask token>

class Solution(object):

    def removeDuplicateLetters(self, s):
        """
        :type s: str
        :rtype: str
        """
        for c in sorted(set(s)):
            suffix = s[s.index(c):]
            if set(suffix) == set(s):
                return c + self.removeDuplicateLetters(suffix.replace(c, ''))
        return ''


<mask token>

class Solution(object):

    def removeDuplicateLetters(self, s):
        """
        :type s: str
        :rtype: str
        """
        for c in sorted(set(s)):
            suffix = s[s.index(c):]
            if set(suffix) == set(s):
                return c + self.removeDuplicateLetters(suffix.replace(c, ''))
        return ''


<mask token>
print(sl.removeDuplicateLetters(s))

class Solution(object):

    def removeDuplicateLetters(self, s):
        """
        :type s: str
        :rtype: str
        """
        for c in sorted(set(s)):
            suffix = s[s.index(c):]
            if set(suffix) == set(s):
                return c + self.removeDuplicateLetters(suffix.replace(c, ''))
        return ''


s = 'cbacdcbc'
sl = Solution()
print(sl.removeDuplicateLetters(s))

class Solution(object):
    def removeDuplicateLetters(self, s):
        """
        :type s: str
        :rtype: str
        """
        for c in sorted(set(s)):
        	suffix = s[ s.index(c) :  ]
        	if set( suffix ) == set(s):
        		return c + self.removeDuplicateLetters(suffix.replace(c, ''))
        return ''



s = "cbacdcbc"

sl = Solution()
print( sl.removeDuplicateLetters( s ) )