I have this problem:
I have a list with let say [2;1;2;1;4;1] and a int, I want to add the integer number to a new list if it accours in the first list, that means that the result should be a new list with [1;1;1] if the integer is 1, I believe i can use tail-recursion and I have used google and looked for something similar here at stackoverflow but I can’t find it.
I suggest you take a look at the built-in higher-order functions:
This is tail-recursive for you already!