LeetCode Entry
242. Valid Anagram
#### Join me on Telegram
242. Valid Anagram easy
blog post
substack

Join me on Telegram
https://t.me/leetcode_daily_unstoppable/440
Complexity
-
Time complexity: \(O(n)\)
-
Space complexity: \(O(n)\), can also be solved in O(1) by computing the
hash
Code
fun isAnagram(s: String, t: String): Boolean =
s.groupBy { it } == t.groupBy { it }