Driver program to test above function
int main ( ) { string str = " geeksforgeeks " ; int index = firstRepeating ( str ) ; if ( index == -1 ) printf ( " Either ▁ all ▁ characters ▁ are ▁ " " distinct ▁ or ▁ string ▁ is ▁ empty " ) ; else printf ( " First ▁ Repeating ▁ character " " ▁ is ▁ % c " , str [ index ] ) ; return 0 ; }