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
Step: 1
Ocaml let rec sumrow row match row with 0 x ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
C++ Primer Plus
Authors: Stephen Prata
6th Edition
978-0321776402, 0321776402
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App