that’s not going to work. You are not removing duplicates, you are trying to do a partial match first.
Now do you want to do it with built in modules only or are you willing to use the code app? Cause the second one will eat much less operations for this.
I suggest changing your array from plain email variables to collections with emails and domains. Then you can use distinct to filter out the ones with the same domains. You can do this by iterating the array, setting a new variable with the domain, and aggregating back to a new array with the domain added. Or you can use the JSON modules if its easier for you.