You are viewing a single comment's thread. Return to all comments →
Golang
func diagonalDifference(arr [][]int32) int32 { var sum1, sum2 int32 for i, _ := range arr { sum1 += arr[i][i] sum2 += arr[len(arr) - i - 1][i] } return int32(math.Abs(float64(sum1 - sum2))) }
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
Golang