Medium

Quiz

#423 Reconstruct Original Digits from English

APPROACH

Given a string s containing an out-of-order English representation of digits 0-9, return the digits in ascending order.

Example 1:

Input: s = "owoztneoer"
Output: "012"

Example 2:

Input: s = "fviefuro"
Output: "45"
1 of 4

What is the optimal approach for this problem?