Remove duplicates in list (Prolog)?

You are getting multiple solutions due to Prolog's backtracking. Technically, each solution provided is correct, which is why it is being generated. If you want just one solution to be generated, you are going to have to stop backtracking at some point.

This is what the Prolog cut is used for. You might find that reading up on that will help you with this problem.

This works without cut, but it needs more lines and another argument. If I change the H2|T2 to S on line three, it will produce multiple results. I don't understand why.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions