I want to make a function that accepts int list list
and returns int list list
, but each time the list is returned. Example:
[[1;2;3];[4;5;6]] -> [[6;5;4];[3;2;1]]
The function that I have encountered so far is missing, which I do not see and returns:
[[4;5;6];[6;5;4]]
It looks like this:
let revrev lstOfLst =
let revrevInner lst =
List.fold (fun rst x -> x::rst) [] lst
List.fold (fun rst x -> x::[(revrevInner x)]) [] lstOfLst
source
share