<p>Given a string <code>s</code> containing an out-of-order English representation of digits <code>0-9</code>, return <em>the digits in <strong>ascending</strong> order</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre><strong>Input:</strong> s = "owoztneoer"
<strong>Output:</strong> "012"
</pre><p><strong class="example">Example 2:</strong></p>
<pre><strong>Input:</strong> s = "fviefuro"
<strong>Output:</strong> "45"
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
	<li><code>s[i]</code> is one of the characters <code>[&quot;e&quot;,&quot;g&quot;,&quot;f&quot;,&quot;i&quot;,&quot;h&quot;,&quot;o&quot;,&quot;n&quot;,&quot;s&quot;,&quot;r&quot;,&quot;u&quot;,&quot;t&quot;,&quot;w&quot;,&quot;v&quot;,&quot;x&quot;,&quot;z&quot;]</code>.</li>
	<li><code>s</code> is <strong>guaranteed</strong> to be valid.</li>
</ul>

class Solution {
public:
    string originalDigits(string s) {
        int n=s.size();
        vector<int> v(26,0);

        for(int i=0;i<n;i++){
            v[s[i]-'a']++;
        }

        vector<int> ans(10,0);

        ans[0]=v['z'-'a'];
        ans[2]=v['w'-'a'];
        ans[4]=v['u'-'a'];
        ans[6]=v['x'-'a'];
        ans[8]=v['g'-'a'];
        ans[1]=v['o'-'a']-ans[0]-ans[2]-ans[4];
        ans[3]=v['t'-'a']-ans[2]-ans[8];
        ans[5]=v['f'-'a']-ans[4];
        ans[7]=v['s'-'a']-ans[6];
        ans[9]=v['i'-'a']-ans[5]-ans[6]-ans[8];

        string str="";

        for(int i=0;i<10;i++){
            if(ans[i]!=0){
                while(ans[i]!=0){
                    str.append(to_string(i));
                    ans[i]--;
                }
            }
        }

        return str;
    }
};
12600