Validate Election Voter ID Format
Validate Election Voter ID Format
EasyStrings0% accepted
An election official in Pune validates voter IDs in format 'MH12ABC3456XYZ' where MH is state code, 12 are digits, ABC are letters, 3456 are digits, XYZ are letters.
Approach
Validate if a voter ID string matches the exact format: 2 state letters, 2 digits, 3 letters, 4 digits, 3 letters.
Input
MH12ABC3456XYZ
Output
true
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