Another my answer vs book answer question
Write a monadic function which appends row and column totals to a numeric matrix.
For example, if Mat is the matrix: 75 14 86 20
31 16 40 51
22 64 31 28
Then Totalise Mat should give: 75 14 86 20 195
31 16 40 51 138
22 64 31 28 145
128 94 157 99 478
Book:
sum←+/[2]Y
Z←Y,[2]sum
sum←+/[1]Z
Z←Z,[1]sum
Mine:
res←tot mat
p←mat,+/mat
res←p⍪+⌿p