-
-
Save bholzer/d728fb960e279c3743ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def checkRows(g): | |
for rows in g: | |
numbersInRow = [] #List to keep track of numbers that appear in the row | |
for number in row: | |
if number != 0 and number in numbersInRow: | |
return g.index(row) #The number has already appeared in the row, so return the row that fails | |
else: | |
numbersInRow.append(number) #This number hasnt appeared in the row yet, so add it to the list | |
print(numbersInRow) | |
return True #Nothing failed, so the row check succeeded | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment