Skip to content

Instantly share code, notes, and snippets.

@akirap3
Created November 28, 2020 05:08
Show Gist options
  • Select an option

  • Save akirap3/405e47fe092f58e3534e49ec32ed2330 to your computer and use it in GitHub Desktop.

Select an option

Save akirap3/405e47fe092f58e3534e49ec32ed2330 to your computer and use it in GitHub Desktop.
def checkSubMatrixSum(slicedMatrix):
    for k in range(3):
        k *= 3
        for j in range(3):
            matrixSum = 0
            for i in range(3):
                subSum = 0
                for num in slicedMatrix[i+k][j]:
                    subSum += num
                matrixSum += subSum
            if matrixSum != 45:
                return False
    return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment