Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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

  • Custom User Avatar

    How could you submit it, even though it fails for a negative first array?