Functional programming can be especially functional when performing lots of different operations on data that with a known amount of variation. See how by diving into this collection.
Consider the function below which uses
fold, and an anonymous helper function.
What is the output, when
x = [1; 2; 3; 4; 5; 6]?
reduce to find the greatest common divisor of all the positive integers in the following file.
Consider the following snippet written in OCaml:
1 2 3
What is the output when the following list is input:
\([8; 2; 5; 5]\)