diff --git a/Algo/Courses/Chapter 6 - Lists (Exercises).md b/Algo/Courses/Chapter 6 - Lists (Exercises).md index 148dc45..0126433 100644 --- a/Algo/Courses/Chapter 6 - Lists (Exercises).md +++ b/Algo/Courses/Chapter 6 - Lists (Exercises).md @@ -110,14 +110,14 @@ let maximum = function ``` ## Exercise 2.1 +```Ocaml +let rec arithmetic_list n a1 r = + if n <= 0 then [] + else a1 :: arithmetic_list (n - 1) (a1 + r) r;; ``` -let arith_list n a r = - if n < 0 then - invalid_arg "n must be superior to 0" - else if n = 0 then - [] - if n = 1 then - a::[] - else let rec arl = - | +## Exercise 2.2 +```Ocaml +let concatenate_lists lst1 lst2 = + lst1 @ lst2;; +```