TheAlgorithms/Go

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

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. 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.

Please provide more context to the problem.