By using Kotlin's syntactic sugar, easy understanding
Intuition\nThe main idea is to treat both sentences as one collection of words and then identify the words that occur only once. By using a frequency count of e
# Intuition\nThe main idea is to treat both sentences as one collection of words and then identify the words that occur only once. By using a frequency count of each word, we can easily filter out the words that are unique.\n\n# Approach\n1. Splitting Strings\n2. Grouping and Counting\n3. Filtering\n4. Converting to Array\n\n# Complexity\n- Time complexity:\nO(n+m)\n\n- Space complexity:\nO(n+m)\n\n# Code\n```kotlin []\nclass Solution {\n    fun uncommonFromSentences(s1: String, s2: String): Array<String> {\n        return (s1.split(" ") + s2.split(" "))\n        .groupingBy{it}\n        .eachCount()\n        .filter{ it.value < 2 }\n        .keys\n        .toTypedArray()\n    }\n}\n```
['String', 'Kotlin']