Hash Agile
Hash Agile
For input "swiss", the output should be "w". You cannot use any built-in string or character
frequency counting functions.
Instructions: Implement manual string traversal and counting logic to solve the problem.
function findFirstUniqueChar(inputString) {
charFrequency[currentChar] += 1;
} else {
charFrequency[currentChar] = 1;
if (charFrequency[currentChar] === 1) {
console.log(findFirstUniqueChar("swiss"));
console.log(findFirstUniqueChar("apple"));
console.log (findFirstUniqueChar("aabbc"));
Outputs:
1. w
2. a
3. c