Driver code
public static void main ( String args [ ] ) { String s = " abcfdeacf " ; int i = FirstRepeated ( s ) ; if ( i != - 1 ) System . out . println ( " Char ▁ = ▁ " + s . charAt ( i ) + " ▁ and ▁ Index ▁ = ▁ " + i ) ; else System . out . println ( " No ▁ repeated ▁ Char " ) ; } }