Problem Statement | |||||||||||||
You are the moderator of a well known forum, and you have noticed that people have been using the word "xox" (quotes for clarity only) very frequently for some time. You would like to measure the scale of that phenomenon by counting the number of letters in the given text that are contained in occurrences of "xox". All occurrences of the substring "xox" should be considered, even if they are not written as standalone words. For example, in the sentence:why the xox u xox there are six letters that are contained in the two occurrences of "xox", but in: send xoxoxs to me plz there are only five letters because the two occurrences of "xox" overlap. Note that the "xox"s in this case are not standalone words. Given a String text return the number of letters that are contained in occurrences of "xox" as described above. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | text will contain between 1 and 50 characters, inclusive. | ||||||||||||
- | text will contain only lowercase letters ('a'-'z') and spaces (' '). | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
|