Skip to main content
3 of 8
added 10 characters in body
betseg
  • 8.7k
  • 3
  • 28
  • 60

##C, 112 101 bytes

j,i,k,l;f(char*s){l=strlen(s);for(i=l;j<l;)k+=(s[j++]-48)*(i>1?i--:-1);return!(k%11)&k&(l>7)&(l<10);}

Returns 0 if invalid, 1 if valid. Try it online!

betseg
  • 8.7k
  • 3
  • 28
  • 60