Simplest Fastest Quickest JAVA Solution via Stack all himself by Lord Noddy
\nclass Solution {\n    public String smallestSubsequence(String s) {\n        int [] lastIndex=new int[26];\n        for(int i=0;i<s.length();i++)\n           
```\nclass Solution {\n    public String smallestSubsequence(String s) {\n        int [] lastIndex=new int[26];\n        for(int i=0;i<s.length();i++)\n            lastIndex[s.charAt(i)-\'a\'] = i;\n            boolean [] seen=new boolean[26];\n            Stack<Integer> st=new Stack<>();\n        \n        for(int i=0;i<s.length();i++)\n        {\n            int c=s.charAt(i) - \'a\';\n            \n            if(seen[c]) continue;\n            \n            while(!st.isEmpty() && st.peek()>c && i < lastIndex[st.peek()])\n            {\n                seen[st.pop()] = false;\n            }\n            st.push(c);\n            seen[c]=true;\n        }\n        StringBuilder sb=new StringBuilder();\n        \n        while(!st.isEmpty())\n        {\n            sb.append((char) (st.pop() + \'a\'));\n        }\n        return sb.reverse().toString();\n        \n    }\n}\n```
['Monotonic Stack', 'Java']