Challenge: Count Keyword Occurrences
Swipe to start coding
You are given a text and a search keyword. Your program must:
-
Count how many times the keyword appears in the text (non-overlapping matches).
-
Find the index of the first occurrence.
-
Find the index of the last occurrence.
-
Print results in a clear, consistent format.
The search must be case-insensitive.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Can you explain this in simpler terms?
What are the next steps I should take?
Can you provide an example?
Awesome!
Completion rate improved to 4.76
Challenge: Count Keyword Occurrences
Swipe to show menu
Swipe to start coding
You are given a text and a search keyword. Your program must:
-
Count how many times the keyword appears in the text (non-overlapping matches).
-
Find the index of the first occurrence.
-
Find the index of the last occurrence.
-
Print results in a clear, consistent format.
The search must be case-insensitive.
Solution
Thanks for your feedback!
single