'Coding has over 700 languages', '67% of programming jobs aren’t in the technology industry', 'Coding is behind almost everything that is powered by electricity'
Topics

# English To Maths

Easy
0/40
Average time to solve is 10m
Contributed by

## Problem statement

Ninja is trying to decipher a string 'S' that contains an out-of-order English representation of the digits 0 - 9.

Your task is to help Ninja to get back the digits in ascending order.

For example :

``````Given string ‘S’ = “toowen”, on the rearrangement of this string we get “onetwo” which implies “12”.
``````
Detailed explanation ( Input/output format, Notes, Images )
Constraints :
``````1 <= T <= 5
1 <= N <= 5000
‘S’ is always valid.

Where ‘N’ is the length of the string ‘S’.

Time limit: 1 sec
``````

Note :

``````You do not need to print anything. It has already been taken care of. Just implement the given function.
``````

#### Sample Input 1 :

``````2
ffoiuver
oenenniowt
``````

#### Sample Output 1 :

``````45
129
``````

#### Explanation Of Sample Output 1 :

``````Test Case 1: We can rearrange ‘S’ as “fourfive” which implies “45”.

Test Case 2 :  We can rearrange ‘S’ as “onetwonine” which implies “129”.
``````

#### Sample Input 2 :

``````2
tsirxee
szixeoneor
``````

#### Sample Output 2 :

``````36
016
``````
Console