Skip to content

Instantly share code, notes, and snippets.

@dps
Created December 29, 2012 17:00
Show Gist options
  • Save dps/4408008 to your computer and use it in GitHub Desktop.
Save dps/4408008 to your computer and use it in GitHub Desktop.
def r(a):
i=a.find('0')
if i<0:print a
[m in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for
j in range(81)]or r(a[:i]+m+a[i+1:])for m in`14**7*9`]
r(raw_input())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment