I am struggling to find a solution to this problem.
Imagine there are 6 sets of colors with varying amounts of colors in each, and colors may be repeated:
['white', 'blue']
['green', 'yellow']
['black']
['yellow', 'blue', 'pink']
['orange', 'red']
['brown', 'white']
If a user enters 6 colors, such as white, blue, pink, black, orange, and yellow, how can I verify that all those colors are included in the sets and that each color can be chosen only once, assuming one color is selected from each set.
Hopefully, my query is clear.
EDIT: rephrasing the question
There are 6 sets of colors listed above, and the user must choose one color from each set. How do I confirm that the user's selection is accurate, considering that the order in which they submit the colors may not match the order of the sets.