I was wondering if there's any way to remove repeating elements in prolog only if they're nearby eachother.
At the moment I could only do this:
Input:
([z,z,z,z,z,x,x,x,c,c,c,z,z,z], R)
And i get output:
R = [x,c,z].
But i wanna see output like this:
R = [z,x,c,z].
Is there any way to do that?
(L, R)
does not remove elements from a list. – Willem Van Onsem