package leetcode;

/**
 * https://leetcode.com/problems/remove-duplicate-letters/
 */
public class Problem316 {
    public String removeDuplicateLetters(String s) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem316 prob = new Problem316();
        System.out.println(prob.removeDuplicateLetters("bcabc")); // abc
        System.out.println(prob.removeDuplicateLetters("cbacdcbc")); // acdb
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -180,24 +180,418 @@
 String s) %7B%0A
+        char%5B%5D chars = s.toCharArray();%0A        Arrays.sort(chars);%0A        int set = 0;%0A        int dup = 0;%0A        for (char c : chars) %7B%0A            int idx = 1 %3C%3C (c - 97);%0A            if ((idx & set) %3E 0) %7B%0A                dup %7C= idx;%0A            %7D%0A            set %7C= idx;%0A        %7D%0A        System.out.println(Integer.toBinaryString(dup));%0A        StringBuilder sb = new StringBuilder();%0A
         // T
@@ -593,16 +593,17 @@
  // TODO
+:
 %0A       
@@ -614,12 +614,21 @@
 urn 
-null
+sb.toString()
 ;%0A  
@@ -717,24 +717,26 @@
 oblem316();%0A
+//
         Syst
@@ -796,16 +796,92 @@
  // abc%0A
+//        System.out.println(prob.removeDuplicateLetters(%22bbcaac%22)); // bac%0A
         

Update problem 316