Online Chess Classes | ZugZwang Academy

View Original

Remove characters from alphanumeric 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

Solution : Replit

Interested in Coding classes please join ZugZwang Academy.

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