Driver Code
public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; int index = firstRepeating ( str ) ; if ( index == - 1 ) Console . Write ( " Either ▁ all ▁ characters ▁ are ▁ " + " distinct ▁ or ▁ string ▁ is ▁ empty " ) ; else Console . Write ( " First ▁ Repeating ▁ character " + " ▁ is ▁ { 0 } " , str [ index ] ) ; } }