Valid Sudoku Leetcode Solution Python