@@ -0,0 +1,1639 @@
+package miscellaneous.math.pattern.lc423_reconstructoriginaldigitsfromenglish;%0A%0A/**%0A * Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order.%0A */%0Apublic class Solution %7B%0A%0A    // %22Unique level%22:%0A    // Zero  tWo  foUr  siX  eiGht%0A    // One   %3C- zerO twO fOur%0A    // Five  %3C- Four%0A    // Seven %3C- Six%0A    // Three %3C- Two eighT%0A    // nIne  %3C- fIve sIx eIght%0A    public String originalDigits(String s) %7B%0A        int%5B%5D cnt = new int%5B10%5D;%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            switch (s.charAt(i)) %7B%0A                case 'z': cnt%5B0%5D++; break; // must be Zero%0A                case 'w': cnt%5B2%5D++; break; // must be tWo%0A                case 'u': cnt%5B4%5D++; break; // must be foUr%0A                case 'x': cnt%5B6%5D++; break; // must be siX%0A                case 'g': cnt%5B8%5D++; break; // must be eiGht%0A                case 'o': cnt%5B1%5D++; break; // could be One zerO twO fOur%0A                case 'f': cnt%5B5%5D++; break; // could be Five Four%0A                case 's': cnt%5B7%5D++; break; // could be Seven Six%0A                case 't': cnt%5B3%5D++; break; // could be Three Two eighT%0A                case 'i': cnt%5B9%5D++; break; // could be nIne fIve sIx eIght%0A            %7D%0A        %7D%0A        cnt%5B1%5D -= cnt%5B0%5D + cnt%5B2%5D + cnt%5B4%5D;%0A        cnt%5B5%5D -= cnt%5B4%5D;%0A        cnt%5B7%5D -= cnt%5B6%5D;%0A        cnt%5B3%5D -= cnt%5B2%5D + cnt%5B8%5D;%0A        cnt%5B9%5D -= cnt%5B5%5D + cnt%5B6%5D + cnt%5B8%5D;%0A%0A        StringBuilder ret = new StringBuilder();%0A        for (int i = 0; i %3C cnt.length; i++) %7B%0A            for (int j = cnt%5Bi%5D; j %3E 0; j--) ret.append(i);%0A        %7D%0A        return ret.toString();%0A    %7D%0A%0A%7D%0A

reconstruct original digits from english