Hash Agile Technologies
Hash Agile Technologies
Write a program to find the first non-repeating character in a string. For input "swiss", the output
should be "w". You cannot use any built-in string or character frequency counting functions.
PROGRAM CODE:
if (charCount[char]) {
charCount[char]++;
} else {
charCount[char] = 1;
if (charCount[char] === 1) {
return char;
return null;
const inputString = "rummy";
console.log(result);
SAMPLE OUTPUTS: