I have an array of emails, for example, ["user@mail.com", "user@differentmail.com"].
As you can see, the array has two emails that have the username "user" before the @ symbol. I need to remove duplicate emails in an array based username (everything before the @ symbol. Here, it is the string "user"). This is because I cannot guarantee that they have the same email domain ("mail" vs "differentmail"). I want to return an array with only one of the emails, where one of them is removed. In this example, the ideal return value would be either ["user@mail.com"] or ["user@differentmail.com"].
I would prefer this to be without a for each loop since I'm running this over about 14,000 lines. Thanks so much!