I’m new to scala and move from C\Cpp so my general think of accesing array elements (and surely arrays of arrays) is now changed (though for\while loops work in scala my co team told me to change my style to a more functional one). Now to my question after this introduction.
I have a 2D array (of integers) like
And I want partual sums of the second coordinate, such that each one will store the sum of its all previous ones (+the current one), on the example I gave this should yield
In C the code would look like: (assuming A is the name of the 2D array)
What is the best (or straightforward) way to write this in scala functional style??
Thanks for any help!