Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This was my original code:
class Sudoku(object):
data = []
d = {}
def init(self, data):
self.data = data
for i in range(len(data)):
self.d[i] = []
def is_valid(self):
if self.data == [['']]:
return False
for i in self.data:
for j in range(len(i)):
if(type(i[j])!=int):
return False
if i.count(i[j]) == 1:
if i[j] not in self.d[j] and j in self.d.keys():
self.d[j].append(i[j])
else:
return False
else:
return False
return True
It works for all of the test cases specified (executed on spyder), but for some reason fails them in the website. Not sure why
How could you submit it, even though it fails for a negative first array?