<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>

#include <stdio.h>
#include <string.h>
class Solution {
public:
    string originalDigits(string s) {
        int Outputlist[10] = {0};
        string string_output;

        for (int i = 0; i< s.size(); i++)
        {
            if (s[i] == 'z') 
            {
                Outputlist[0]++;
            }
            else if (s[i] == 'w') 
            {
                Outputlist[2]++;
            }
            else if (s[i] == 'u') 
            {
                Outputlist[4]++;
            }
            else if (s[i] == 'x') 
            {
                Outputlist[6]++;
            }
            else if (s[i] == 'g') 
            {
                Outputlist[8]++;
            }
            else if (s[i] == 's') 
            {
                Outputlist[7]++;
            }
            else if (s[i] == 'v') 
            {
                Outputlist[5]++;
            }
            else if (s[i] == 'r') 
            {
                Outputlist[3]++;
            }
            else if (s[i] == 'o') 
            {
                Outputlist[1]++;
            }
            else if (s[i] == 'i') 
            {
                Outputlist[9]++;
            }
        }
    Outputlist[7] -=  Outputlist[6];
    Outputlist[5] -=  Outputlist[7];
    Outputlist[3] -=  Outputlist[0]+Outputlist[4];
    Outputlist[1] -=  Outputlist[0] + Outputlist[2] + Outputlist[4];
    Outputlist[9] -=  Outputlist[5] + Outputlist[6] + Outputlist[8];
    for (int j = 0; j < 10; j++)
    {
        //printf ("%d",Outputlist[j]);
        for (int k = 0; k < Outputlist[j]; k++)
        {
            string_output.append(to_string(j));
        }
        
    }
    
    return string_output;
    }
};
12500