You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/g2301_2400/s2315_count_asterisks/readme.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,11 @@ Return _the number of_ `'*'` _in_ `s`_, **excluding** the_ `'*'` _between each p
14
14
15
15
**Output:** 2
16
16
17
-
**Explanation:** The considered characters are underlined: "l|\*e\*et|c\*\*o|\*de|".
17
+
**Explanation:** The considered characters are underlined: "<ins>l</ins>|\*e\*et|<ins>c\*\*o</ins>|\*de|".
18
18
19
-
The characters between the first and second '|' are excluded from the answer. Also, the characters between the third and fourth '|' are excluded from the answer. There are 2 asterisks considered. Therefore, we return 2.
19
+
The characters between the first and second '|' are excluded from the answer.
20
+
21
+
Also, the characters between the third and fourth '|' are excluded from the answer. There are 2 asterisks considered. Therefore, we return 2.
20
22
21
23
**Example 2:**
22
24
@@ -32,12 +34,12 @@ The characters between the first and second '|' are excluded from the answer. Al
32
34
33
35
**Output:** 5
34
36
35
-
**Explanation:** The considered characters are underlined: "yo|uar|e\*\*|b|e\*\*\*au|tifu|l".
37
+
**Explanation:** The considered characters are underlined: "<ins>yo</ins>|uar|<ins>e\*\*</ins>|b|<ins>e\*\*\*au</ins>|tifu|<ins>l</ins>".
36
38
37
39
There are 5 asterisks considered. Therefore, we return 5.
38
40
39
41
**Constraints:**
40
42
41
43
*`1 <= s.length <= 1000`
42
44
*`s` consists of lowercase English letters, vertical bars`'|'`, and asterisks`'*'`.
43
-
*`s` contains an**even** number of vertical bars`'|'`.
45
+
*`s` contains an**even** number of vertical bars`'|'`.