A chat message is a laugh if it contains ha. Given msg, return how many times ha appears, ignoring case and counting non-overlapping occurrences from left to right.
Examples
Input: msg = "hahaha"
Output: 3
Input: msg = "HA! That was hard"
Output: 3
Constraints
0 <= len(msg) <= 5000msgmay contain letters, digits, spaces and punctuation
Goals
- Count non-overlapping occurrences of a substring
- Ignore letter case