HW 3.8 (Sudoku) still marked as 'Incorrect' in Progress

@PeterUdacity or @fnenu I'd appreciate it if you would respond. When I hit submit now it says this solution is correct. I have also run it against the test cases posted on this forum and it passes all except for one that inputs an invalid Sudoku square ([1,2,3],[2,3,1],[3,1,2,1]). If there is a valid test case that my code does not pass or you haven't gotten around to doing all of the re-grading please let me know. Otherwise, I think my progress for this homework problem should be updated to 'Correct'. Thanks. Here is my code:

def check_sudoku(p):
    if p == None:       # invalid array check
        return False
    largest = len(p)
    columns = []
    rownum = 0
    if largest == 0 or len(p[0]) != largest:    # invalid array checks
        return False
    while rownum < largest:
        testrow = []
        colnum = 0
        while colnum < largest:
            val = p[rownum][colnum]
            if val < 1 or val > largest:
                return False
            if val in testrow:
                return False
            testrow.append(val)
            if rownum == 0:
                testcol = []
                columns.append(testcol)
            if val in columns[colnum]:
                return False
            columns[colnum].append(val)
            colnum += 1
        rownum += 1
    return True

asked 07 Apr '12, 17:34

Van%20Dillon's gravatar image

Van Dillon
1.9k1425
accept rate: 25%

edited 07 Apr '12, 18:10


One Answer:

The regrading hasn't happened yet.

link

answered 07 Apr '12, 18:23

fnenu-1's gravatar image

fnenu-1 ♦♦
18.5k1981231

OK, thanks.

(07 Apr '12, 18:52) Van Dillon Van%20Dillon's gravatar image
Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×15,264
×118
×112
×103
×72
×5

Asked: 07 Apr '12, 17:34

Seen: 126 times

Last updated: 07 Apr '12, 18:52