using System;
public class Program
{
// A unique character is one which apperas only once in a string. Given a string consisting of lowercase English letters only,
//return the index of the first occurence of a unique character in the string using 1-based indexing. If the string doesn't contain any unique character, return -1
//
// Example, s= "statistics".
//The unique characters are [a, c] among which a occurs first. Using 1-based indexing, it is at index 3.
public static void Main()
Console.WriteLine(GetUniqueCharacter("satt"));
}
public static int GetUniqueCharacter(string s)
bool counter = true;
for(int i = 0 ; i < s.Length; i++){
counter = true;
for(int j = i+1 ; j < s.Length;j++){
if(s[i] == s[j]){
counter = false;
break;
if(counter){
return i+1;
return -1;