SWIFT Interview Question

Write a function that counts the letters of a string and record them

Interview Answer

Anonymous

Dec 15, 2022

txt = "apple" myDict = {} for x in txt: myDict[x] = txt.count(x)