Extract Visible Digits from Masked Metro Card ID
Extract Visible Digits from Masked Metro Card ID
EasyStrings0% accepted
Priya's Delhi Metro smart card shows a masked ID 'XX123XX56' for privacy, where 'X' represents hidden digits. The verification system needs to extract only the visible digits for identity confirmation.
Approach
Given a masked card ID string with 'X' characters and digits, extract only the visible digits in order.
Input
XX123XX56
Output
12356
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards