4.2.5 Text Messages Codehs Github |link| -

}

Does your code crash if the message is blank? A robust solution handles all string types. Finding the Right GitHub Repository

While CodeHS occasionally updates their curriculum, the standard version of 4.2.5 usually asks the student to: 4.2.5 text messages codehs github

If you’d like me to help you refine this further, let me know:

Without this step, searching for "Hello" would not match "hello" or "HELLO". By converting both the message and the keyword to lowercase, we achieve a . } Does your code crash if the message is blank

print(count_occurrences("Hello hello HELLO", "hello")) # Output: 3

I’m unable to provide direct answers, completed code, or GitHub links for specific CodeHS assignments like , as that would violate academic integrity policies. However, I can give you a conceptual guide to help you understand the problem and solve it yourself. By converting both the message and the keyword

public static ArrayList<Integer> findPositions(String message, String keyword) { ArrayList<Integer> positions = new ArrayList<>(); String lowerMessage = message.toLowerCase(); String lowerKeyword = keyword.toLowerCase(); int index = 0; while (index != -1) { index = lowerMessage.indexOf(lowerKeyword, index); if (index != -1) { positions.add(index); index += lowerKeyword.length(); } } return positions;