Skip to content

Latest commit

 

History

History

remove_duplicate_letters

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Problem

Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.

Example: Given "bcabc" Return "abc"

Given "cbacdcbc" Return "acdb"