Count Special Segments in a String

Company: Uber She++_23jan

Difficulty: medium