Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function countLetter(word, letter)
- return (select(2, word:gsub(letter, letter)))
- end
- local function countLetterInDictionary(dict, letter)
- local total = 0
- for _, word in pairs(dict) do
- total = total + countletter(word, letter)
- end
- return total
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement