Validate Election Voter ID Checksum
Validate Election Voter ID Checksum
MediumStrings0% accepted
In Delhi municipal elections, voter IDs follow format: 2-letter district code + 7-digit number where the last digit is a check digit. The check digit equals (sum of first 6 digits) mod 10. Validate if voter IDs have correct checksums.
Approach
Given a voter ID string in format XX1234567 (state code + 7 digits where last digit is check), validate if the check digit is correct using formula: check = (sum of first 6 digits) mod 10.
Input
DL1111116
Output
Valid
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