TikTok Interview Question

String manipulation/counting certain chars in string.