TikTok interview question

String manipulation/counting certain chars in string.