Skip to content

Instantly share code, notes, and snippets.

View csemresari's full-sized avatar

Emre Sari csemresari

  • London
View GitHub Profile
// 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 {