Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isInformationConsistent(evidences)
- x = 0
- y = 0
- x_length = evidences.length
- y_length = evidences[0].length
- verdict = 0
- while (y < y_length)
- while (x < x_length)
- if evidences[x][y] == 1 and verdict == -1 then
- return false
- end
- if evidences[x][y] == -1 and verdict == 1 then
- return false
- end
- if evidences[x][y] == 1 then
- verdict = 1
- end
- if evidences[x][y] == -1 then
- verdict = -1
- end
- x = x + 1
- end
- y = y + 1
- x = 0
- verdict = 0
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment