func isValidIranianNationalCode(input string) bool { for i := 0; i < 10; i++ { if input[i] < '0' || input[i] > '9' { return false } } check := int(input[9] - '0') sum := 0 for i := 0; i < 9; i++ { sum += int(input[i]-'0') * (10 - i) } sum %= 11 return (sum < 2 && check == sum) || (sum >= 2 && check+sum == 11) }
Mohamadrezashiri1 opened this issue · 1 comments
Mohamadrezashiri1 commented
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
raklaptudirm commented
Please provide more context to the problem.