Driver code
int main ( ) { string list [ ] = { " abab " , " gfg " } ; for ( string s : list ) { int cnt = countSub ( s ) ; int withEmptyString = cnt + 1 ; cout << " With ▁ empty ▁ string ▁ count ▁ for ▁ " << s << " ▁ is ▁ " << withEmptyString << endl ; cout << " Without ▁ empty ▁ string ▁ count ▁ for ▁ " << s << " ▁ is ▁ " << cnt << endl ; } return 0 ; }