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 "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
Ocaml let rec sumrow row match row with ... View full answer
Get step-by-step solutions from verified subject matter experts
