Practice Reconstruct Original Digits from English
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given a string s containing an out-of-order English representation of digits 0-9, return the digits in ascending order.
Source: Reconstruct Original Digits from English on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
s = "owoztneoer"
Output
"012"
# Example 2
Input
s = "fviefuro"
Output
"45"
Constraints
1 <= s.length <= 10^5
s[i] is one of the characters ["e","g","f","i","h","o","n","s","r","u","t","w","v","x","z"].
s is guaranteed to be valid.
Related LeetCode Problems
Practice more problems similar to Reconstruct Original Digits from English.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.