- create a hashset called uniqueWords
- iterate through each word in the array
- iterate through each character in the word
- construct a formatted string , following the defined rules
- once we encounter an '@', push the remaining substr immediately into the formatted string
- insert the formatted string into the hashset if it doesnt already exist
- return the hashsets size
π€What Did I Struggle With?
~
π‘ Explanation of Solution
same as initial thoughts
β Complexity Analysis
Time Complexity: O(n * k)
where n is the number of emails
and k is the number of characters in an email
Space Complexity: O(k) used to store a formatting string with a max size of k characters