From 65575da3ac605064213ccc648b8b1c698f844a9d Mon Sep 17 00:00:00 2001 From: Dhruv Maniya Date: Thu, 9 Jul 2026 12:19:00 +0530 Subject: [PATCH] Fix word occurrence doctest variable typo --- strings/word_occurrence.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/word_occurrence.py b/strings/word_occurrence.py index 5a18ebf771e4..79769fb8944c 100644 --- a/strings/word_occurrence.py +++ b/strings/word_occurrence.py @@ -7,8 +7,8 @@ def word_occurrence(sentence: str) -> dict: """ >>> from collections import Counter >>> SENTENCE = "a b A b c b d b d e f e g e h e i e j e 0" - >>> occurence_dict = word_occurrence(SENTENCE) - >>> all(occurence_dict[word] == count for word, count + >>> occurrence_dict = word_occurrence(SENTENCE) + >>> all(occurrence_dict[word] == count for word, count ... in Counter(SENTENCE.split()).items()) True >>> dict(word_occurrence("Two spaces"))