Remove characters from alphanumeric string

Alpha numeric string

Remove all characters except the numeric characters from an alphanumeric string.

Example 1:

Input: S = "AA1d23cBB4"
Output: 1234
Explanation: Remove all characters
other than numbers

Example 2:

Input: S = "a1b2c3"
Output: 123
Explanation: Remove all characters
other than numbers

Remove Alpha Numeric String Solution

Interested in Coding classes please join ZugZwang Academy.

For More Updates Subscribe to Algothink by Bharat Divyang (IIT/IIM).

Previous
Previous

Machine Learning & Artificial Intelligence

Next
Next

Maximum Collatz sequence length | Collatz Conjecture