Write a function that takes a multi dimensional array as input. The diagonal of the array consists of zeros. Assign the sum of each row to the diagonal element of that row. Example: Original array: 0 6 7 8 6 0 8 9 7 8 0 10 8 9 10 0 result is: 21 6 7 8 6 23 8 9 7 8 25 10 8 9 10 27