Prefix first occurrence of every character in the input string - Java Quiz Question


Given the input string, then write a program to prefix only the first occurrence of every character in the given input string. i.e. if the same character is repeated then only prefix for the first occurrence.

Input (String, Char) Output (String)
Coconut, T TCTocoTnTuTt
Dhoni, E EDEhEoEnEi
Potatoo, H HPHoHtHatoo
Tatoo, P PTPatPoo
Welcome, R RWReRlRcRoRme



class PrefixFirstOccurrenceOfEveryCharacter
{
    public static void main(String s[])
    {
        System.out.println("After prefixing : " + prefixEveryCharacter("Coconut", 'T'));

    }


    public static String prefixEveryCharacter(String word, char prefix) {
    }

}