This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Checks if a string is anagram with another | |
extension String { | |
func isAnagramWith(s: String) -> Bool { | |
var dict = [Character:Int]() | |
for char in self{ | |
dict[char] = 1 + (dict[char] ?? 0) | |
} | |
for char in s { | |
if dict[char] != nil { |