<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) {
        map<char, int> mp;
        for(char c : s){
            mp[c]++;
        }
        vector<int> ans;
        while(mp['z']){
            ans.push_back(0);
            mp['z']--;
            mp['e']--;
            mp['r']--;
            mp['o']--;
        }
        while(mp['w']){
            ans.push_back(2);
            mp['t']--;
            mp['w']--;
            mp['o']--;
        }
        while(mp['u']){
            ans.push_back(4);
            mp['f']--;
            mp['o']--;
            mp['u']--;
            mp['r']--;
        }
        while(mp['x']){
            ans.push_back(6);
            mp['s']--;
            mp['i']--;
            mp['x']--;
        }
        while(mp['f']){
            ans.push_back(5);
            mp['f']--;
            mp['i']--;
            mp['v']--;
            mp['e']--;
        }
        while(mp['v']){
            ans.push_back(7);
            mp['s']--;
            mp['e']--;
            mp['v']--;
            mp['e']--;
            mp['n']--;
        }
        while(mp['g']){
            ans.push_back(8);
            mp['e']--;
            mp['i']--;
            mp['g']--;
            mp['h']--;
            mp['t']--;
        }
        while(mp['t']){
            ans.push_back(3);
            mp['t']--;
            mp['h']--;
            mp['r']--;
            mp['e']--;
            mp['e']--;
        }
        while(mp['o']){
            ans.push_back(1);
            mp['o']--;
            mp['n']--;
            mp['e']--;
        }
        while(mp['i']){
            ans.push_back(9);
            mp['n']--;
            mp['i']--;
            mp['n']--;
            mp['e']--;
        }
        sort(ans.begin(), ans.end());
        s = "";
        for(int i = 0; i < ans.size(); i++){
            s.push_back(ans[i] + '0');
        }
        return s;
    }
};
13200