My swift solution 1line


  • 1
    A

    class Solution {

    func isAnagram(s: String, _ t: String) -> Bool {
        return [Character](s.characters).sort() == [Character](t.characters).sort()
    }
    

    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.