java.lang.Object
g0401_0500.s0423_reconstruct_original_digits_from_english.Solution

public class Solution extends java.lang.Object
423 - Reconstruct Original Digits from English.

Medium

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”

Constraints:

  • 1 <= s.length <= 105
  • 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.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    java.lang.String
    originalDigits(java.lang.String s)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • originalDigits

      public java.lang.String originalDigits(java.lang.String s)