func occurencesOfCharacters(in text: String) -> [Character: Int] {
var dicOfChars: [Character: Int] = [:]
for character in text.characters {
if dicOfChars[character] != nil {
dicOfChars[character]? += 1
}
else {
dicOfChars[character] = 1
}
}
return dicOfChars
}
print(occurencesOfCharacters(in: "memerr"))