Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

Ocaml let rec sumrow row match row with 0 x ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Programming questions

Question

2. Distinguish between cobranding and comarketing.

Answered: 1 week ago

Question

For any events A and B with , show tha .

Answered: 1 week ago