Driver program to test above function
string = " geeksforgeeks " NEW_LINE index = firstNonRepeating ( string ) NEW_LINE if index == 1 : NEW_LINE INDENT print " Either ▁ all ▁ characters ▁ are ▁ repeating ▁ or ▁ string ▁ is ▁ empty " NEW_LINE DEDENT else : NEW_LINE INDENT print " First ▁ non - repeating ▁ character ▁ is ▁ " + string [ index ] NEW_LINE DEDENT