hi
I am new to prolog. I have a problem in which I have a list of items[a,b,c,d,e,f,g]. Now say each item has its own category a b,d are all cat 1 items while e,g are cat 2 and c is cat 3 while f is cat 4. I want to reduce this list in such a way that it contains at most 2 items from any category which means ot of a,b,d one item has to be cut so the final list will become [a,b,c,e,f,g]. How would I do that in prolog.
I am new to prolog. I have a problem in which I have a list of items[a,b,c,d,e,f,g]. Now say each item has its own category a b,d are all cat 1 items while e,g are cat 2 and c is cat 3 while f is cat 4. I want to reduce this list in such a way that it contains at most 2 items from any category which means ot of a,b,d one item has to be cut so the final list will become [a,b,c,e,f,g]. How would I do that in prolog.