letterCount edge cases functional solution