I am having difficulty coming with a solution for this.
Lets say there are 6 arrays of colors with 1-3 colors in each, and colors can be repeated:
['white', 'blue']
['green', 'yellow']
['black']
['yellow', 'blue', 'pink']
['orange', 'red']
['brown', 'white']
And a user inputs 6 colors, for example: white, blue, pink, black, orange, yellow. How do I check that all of those colors are part of the arrays AND all of them can be chosen, assuming only one can be chosen from each array.
I hope my question is understandable.
EDIT: rephrasing the question
there are 6 arrays of colors, as seen above and the user has to select 1 from each array. how do i check that the user's input is correct, assuming that the order he submits it is not the order of the arrays.
if?