Already have an account? Log in here.
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]
?
1 

Already have an account? Log in here.
Use fold
or reduce
to find the greatest common divisor of all the positive integers in the following file.
Already have an account? Log in here.
Consider the following snippet written in OCaml:
1 2 3 

What is the output when the following list is input:
\([8; 2; 5; 5]\)
Already have an account? Log in here.
Problem Loading...
Note Loading...
Set Loading...