Count Asterisks
Easy
Strings
String
Count asterisks '*' outside pairs of vertical bars '|'. Bars always come in pairs.
Constraints
1 ≤ len ≤ 1000
Examples
Example 1:
Input: l]|o]e*et|c]o|*de|
Output: 2
Example 2:
Input: iamprogrammer
Output: 0
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console