Count Word Frequency medium
dictionaries

Write a function solution(text) that returns a dictionary mapping each word to its frequency in text. Words are separated by spaces. Ignore punctuation and treat words case-insensitively.

Example

solution("the cat sat the cat") → {"the": 2, "cat": 2, "sat": 1}
solution.py
💡 Tip: Press Ctrl+Enter to run