I have a string statistics. I need to find the unique or non repeating characters a,c. I found a solution. But it need to use three for loops. How we can find in a easy solution which is less time consumption.
List<String> list=[];
List<String> newList=[];
//Loop one
for(int i=0; i<name.length;i++){
list.add(name[i]);
}
print(list);
newList =list.toSet().toList();
//Loop two
for(int j=0;j<list.length;j++){
//Loop three
for(int k=j+1;k<list.length;k++){
if(list[j]==list[k]){
newList.remove(list[j]);
}
}
}
print(newList);