Skip to content

Instantly share code, notes, and snippets.

@dps
Created December 29, 2012 16:54
Show Gist options
  • Save dps/4407980 to your computer and use it in GitHub Desktop.
Save dps/4407980 to your computer and use it in GitHub Desktop.
open String let rec s p=try let rec(%)=(mod)and i=index p '0'and b
j=i<>j&(i/9=j/9||i%9=j%9||i/27=j/27&i%9/3=j%9/3)&p.[i]=p.[j]||j<80&b(j+1)in
iter(fun c->p.[i]<-c;b 0||()=s p;())"948721536";p.[i]<-'0'with
_->print_string p;;s(read_line())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment