Search Results

Search found 1 results on 1 pages for 'user1790201'.

Page 1/1 | 1 

  • Sum of a matrix, even or odd

    - by user1790201
    This function receives a numeric matrix represented as a list of rows, where each row is in turn a list. Assume that it is a square matrix: all rows have the same length and there are as many rows as elements in each row. Also assume that the matrix is at least of dimension 2 by 2 (i.e. minimally the matrix has 2 rows with 2 elements each) The function should return a list with as many elements as number of rows. Element i in the resulting list should have the sum of the values in row i. For example, if the matrix is 1 2 3 10 20 30 100 200 300 then this function should return the list [6,60,600] That is, addValuesInAllRows( [ [1,2,3], [10,20,30], [100,200,300] ] ) should return [6,60,600] Isn't this sort of similar but how would you sum up the list individually

    Read the article

1