Implement a predicate remdup/2 which removes duplicate elements from a list,
indexes the remaining elements (1 to n), and prints out how many elements there are.
For example,
?- remdup([7,2,4,5,6,7,9,4],X).
There are 6 elements in the list.
X = [[1,7],[2,2],[3,4],[4,5],[5,6],[6,9]]
!! the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.