zhukov000

Sudoku

Jun 24th, 2021
680
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = [ list(map(int, input())) for i in range(9) ]
  2. ai = int(input())
  3. aj = int(input())
  4.  
  5. ans = { i for i in range(1, 10) }
  6. for i in range(9):
  7.   ans = ans - set([a[ai][i], a[i][aj]])
  8. ti = ai - ai % 3
  9. tj = aj - aj % 3
  10. for i in range(3):
  11.   for j in range(3):
  12.     ans -= set([a[ti + i][tj + j]])
  13. print(*sorted(ans), sep='\n')
RAW Paste Data