From 62f1dec61c27899b7bcd8703a34d389cada9d4b9 Mon Sep 17 00:00:00 2001 From: Petro Kurinnyi Date: Tue, 11 Nov 2025 22:22:39 +0200 Subject: [PATCH 1/2] Solution --- app/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 37b9f338b..e613d4440 100644 --- a/app/main.py +++ b/app/main.py @@ -1,3 +1,2 @@ def count_occurrences(phrase: str, letter: str) -> int: - # write your code here - pass + return phrase.lower().count(letter.lower()) From 2a3f17ff797d6404aa074f8c176b3fc99c043548 Mon Sep 17 00:00:00 2001 From: Petro Kurinnyi Date: Tue, 11 Nov 2025 22:28:58 +0200 Subject: [PATCH 2/2] PR review fix --- app/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/main.py b/app/main.py index e613d4440..9a6dbb647 100644 --- a/app/main.py +++ b/app/main.py @@ -1,2 +1,9 @@ def count_occurrences(phrase: str, letter: str) -> int: + """ + Count occurrences of a letter in a phrase (case insensitive). + + :param phrase: The phrase to search within. + :param letter: The letter to count occurrences of. + :return: The number of occurrences of the letter in the phrase. + """ return phrase.lower().count(letter.lower())