I have the following array, I need to get unique arrays or set union (the same thing only once) from the list of arrays, and also exclude empty arrays. How can this be achieved on the server side?
{
"slots": [
[],
["08:30AM", "08:40AM", "08:50AM", "09:00AM", "09:10AM", "09:20AM", "09:30AM", "09:40AM", "09:50AM", "10:00AM", "10:10AM", "10:20AM", "10:30AM", "10:40AM", "10:50AM", "11:00AM", "11:10AM", "11:20AM", "11:30AM"],
["08:30AM", "08:40AM", "08:50AM", "09:00AM", "09:10AM", "09:20AM", "09:30AM", "09:40AM", "09:50AM", "10:00AM", "10:10AM", "10:20AM", "10:30AM", "10:40AM", "10:50AM", "11:00AM", "11:10AM", "11:20AM", "11:30AM"],
["08:30AM", "08:40AM", "08:50AM", "09:00AM", "09:10AM", "09:20AM", "09:30AM", "09:40AM", "09:50AM", "10:00AM", "10:10AM", "10:20AM", "10:30AM", "10:40AM", "10:50AM", "11:00AM", "11:10AM", "11:20AM", "11:30AM"],
[],
[],
[]
],
}
I need a conclusion like,
{
"slots": [
["08:30AM", "08:40AM", "08:50AM", "09:00AM", "09:10AM", "09:20AM", "09:30AM", "09:40AM", "09:50AM", "10:00AM", "10:10AM", "10:20AM", "10:30AM", "10:40AM", "10:50AM", "11:00AM", "11:10AM", "11:20AM", "11:30AM"]
}