I have the following situation where I need to remove some elements from an array. I have an array with elements as followed:
[
"white & blue", "white & red", "white & black",
"blue & white", "blue & red", "blue & black",
"red & white", "red & blue", "red & black",
"black & white", "black & blue", "black & red",
"white", "blue", "red", "black",
"white & blue & red & black"
]
I need to transform this into an array with only these elements:
[
"white & blue", "white & red", "white & black",
"blue & red", "blue & black",
"red & black",
"white", "blue", "red", "black",
"white & blue & red & black"
]
IN the above example, elements "white & blue"
and "blue & white"
need to be treated as being the same, keeping only one of them and removing the other.
I have not found a way that works. How I can do it?