Leetcode: Remove Duplicate Letters

Remove Duplicate Letters

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.

Given "bcabc"
Return "abc"
Given "cbacdcbc"
Return "acdb"

Github: code.dennyzhang.com

Credits To: leetcode.com

Leave me comments, if you have better ways to solve.

## Blog link: https://code.dennyzhang.com/remove-duplicate-letters


Share It, If You Like It.

Leave a Reply

Your email address will not be published.