title: How can I delete specific appearances of elements from an array in Prolog?
body: <p>I want to delete only second appearance of each element in given array and return the result in a new array. The given array can have have atomic elements but also can have list like element within it.
  <br />
  the predicate should be called like this: delete_second(L1,L2).<br />
  L1=[1,2,4,1,[1,2,3,[4]],2,1]<br />
  L2=[1,2,4,[1,3,[]],2,1].</p>