LeetCodeCount AsterisksCount AsterisksEasyStringSolution export function countAsterisks(s: string): number { let answer = 0; let barCount = 0; for (const char of s) { if (char === '*' && barCount % 2 === 0) { answer += 1; } if (char === '|') { barCount += 1; } } return answer; }LeetCodeCount Asteriskshttps://leetcode.com/problems/count-asterisks