
I scarcity succor solving this doubt. It upright has a bug and I jangle discover it.
Given a string, repay the controlemost non-repeated quality. If there are no choice qualitys, repay vain. business controlemostUniqueC ipu) { control(var i = 0;i
The controlemost control loop should be iterated prepare input.length-1 (Means if input’s extension is 5 as in proof instance “aabbc” the loop should latest prepare 4) . The proof instance “aabbc” is feeble consequently the loop never iterates to the latest prize. So , subjoin a similar type in the circumstances of controlemost control loop.
business controlemostUnique(input) {
for(var i=0;i<=input.length-1;i++){
var char1=input.charAt(i);
var base=false;
for(var j=0;j<input.length;j++){
if(i==j){
continue;
}
var char2=input.charAt(j);
if(char1==char2){
found=true;
break;
}
}
if(!found){
repay char1;
}
}
repay vain;
}