<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 helper(int num, int freq){
    string res = "", tmp = to_string(num);
    for(int i=1;i<=freq;i++) res += tmp;
    return res;
    }
    string originalDigits(string s) {
    vector<int> hash(256, 0), num(10, 0);
    for(auto c : s) hash[(int)c]++;
    num[0] = hash[(int)'z'];  // 0
    hash[(int)'o'] -= num[0];

    num[2] = hash[(int)'w'];  // 2
    hash[(int)'o'] -= num[2];
    
    num[4] = hash[(int)'u'];  // 4
    hash[(int)'f'] -= num[4];
    hash[(int)'o'] -= num[4];

    num[6] = hash[(int)'x'];  // 6

    num[8] = hash[(int)'g'];  // 8
    hash[(int)'h'] -= num[8];

    num[1] = hash[(int)'o'];  // 1
    hash[(int)'n'] -= num[1];

    num[3] = hash[(int)'h'];  // 3

    num[5] = hash[(int)'f'];  // 5
    hash[(int)'v'] -= num[5];

    num[7] = hash[(int)'v'];  // 7
    hash[(int)'n'] -= num[7];

    num[9] = hash[(int)'n'] / 2; // 9

    string res = "";
    for(int i=0;i<num.size();i++){
        if(num[i] > 0) res += helper(i, num[i]);
    }
    return res;
    }
};
11000