Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def crossingSum(matrix, a, b)
- sum = 0
- i = 0
- while (i < matrix[0].length)
- sum = sum + matrix[a][i]
- i = i + 1
- end
- j = 0
- while (j < matrix.length)
- sum = sum + matrix[j][b]
- j = j + 1
- end
- sum = sum - matrix[a][b]
- return sum
- end
Advertisement
Add Comment
Please, Sign In to add comment