@@ -0,0 +1,902 @@
+import urllib2%0A%0Adef same_row(i,j): return (i/9 == j/9)%0Adef same_col(i,j): return (i-j) %25 9 == 0%0Adef same_block(i,j): return (i/27 == j/27 and (i %25 9)/3 == (j %25 9)/3)%0A%0Adef solve(x):%0A    i = x.find('0')%0A    if i == -1:%0A        return int(x%5B0:3%5D)%0A%0A    ex = set()%0A    for j in range(81):%0A        if same_row(i,j) or same_col(i,j) or same_block(i,j):%0A            ex.add(x%5Bj%5D)%0A%0A    for m in '123456789':%0A        if not m in ex:%0A            ret = solve(x%5B:i%5D + m + x%5Bi + 1:%5D)%0A            if ret != 0:%0A                return ret%0A%0A    return 0%0A%0Aif __name__ == %22__main__%22:%0A    file = urllib2.urlopen('https://projecteuler.net/project/resources/p096_sudoku.txt').readlines()%0A    s = %5B%5D%0A    cur = %5B%5D%0A    for line in file:%0A        if not 'Grid' in line:%0A            cur.append(line%5B:9%5D)%0A        if len(cur) == 9:%0A            s.append(''.join(x for x in cur))%0A            cur = %5B%5D%0A    print sum(solve(x) for x in s)%0A

add 96