I am a beginner with OCmal. I have a list named l
and a number stored in N
.I need to find the number of times N
repeats in l
.
let l = [1;2;3;4;5;6;7;1;9;10;11];;let n = 1;;
I want to write a function which tells that number of times n
is present in l
.
I started like this but I am blocked:
for i = 0 to (List.length l) do(* codes here: i want to find that the value of N is present twice in the list *)done;;