Driver code
int main ( ) { string arr [ ] = { " abc " , " abcabc " , " abc " } ; int n = sizeof ( arr ) / sizeof ( string ) ; int L = 1 ; int R = 3 ; string str = " abc " ; cout << NumOccurrences ( arr , n , str , L , R ) ; return 0 ; }