Function to return the index of the next occurrence of character ch in str starting from the given index
int nextOccurrence ( string str , int n , int start , char ch ) { for ( int i = start ; i < n ; i ++ ) {