How to reverse even sublists of a list if we assume that we count elements from 0. I want the solution to be "manually-coded". I've got a big problem with this task.
For example:
Function([[1;2;3] ; [2;3] ; [1;2;3] ; [5;6;7]])
returns:
([[3;2;1] ; [2;3] ; [3;2;1] ; [5;6;7]])
I already created a function that reverse a single list:
let rev =
let rec rev_append acc l =
match l with
[] -> acc
| h::t -> rev_append (h::acc) t in
fun l -> rev_append [] l;;
But now i am stuck.