I am an Intermediate in programming. I'm a few weeks into my first programming class, so please bear with me. I am not a person to ask for help, so I have searched for an answer extensively with no luck. This is also my first time posting anything in any type of forum, so if my question structure is off I'm sorry and I will correct for future posts.
public class removeDuplicate5 {
public static boolean[] map = new boolean[26];
public static void removeDuplicates(String str, int idx, String newString) {
if (idx == str.length()) {
System.out.println(newString);
return;
}
char currChar = str.charAt(idx);
if (map[currChar - 'a']) {
removeDuplicates(str, idx + 1, newString);
} else {
newString += currChar;
map[currChar - 'a'] = true;
removeDuplicates(str, idx + 1, newString);
}
}
public static void main(String[] args) {
String company = "Inxee";
removeDuplicates(company, 0, "");
}
}