Question: Write a function sum_rows: int list list -> int list that takes a list of int lists (call an internal list a row) and

Write a function sum_rows: int list list -> int list that takes a list of int lists (call an internal list a

Write a function sum_rows: int list list -> int list that takes a list of int lists (call an internal list a "row") and returns a one-dimensional list of ints, each int equal to the sum of the corresponding row in the input. let sum_rows (rows:int list list) : int list = (* YOUR CODE HERE *) assert (sum_rows [[1; 2]; [3;4]] = [3; 7]); assert (sum_rows [[5; 6; 7; 8; 9]; [10]] = [35; 10])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Ocaml let rec sumrow row match row with ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!