(str) take the str parameter being passed, which will contain only alphabetic character and spaces, and return the first non repeating character. For eg. If str is "agettkgaeee" then your program should return k. The string will always contain at least one character and there will always be at least one non repeating character.
Answers
The following codes have been written using Python.
We define a function using that has been designed for the same purpose. We assign a variable to be used as the variable that holds the non-repeating character. We then start an iteration loop to traverse through the characters of the string. As per the question, the string must contain only letters/spaces. We use to check if the character is a letter through a conditional statement. If it is, we give another conditional statement to check the occurrences of the character in the string using . If the count of the character in the string is 1, we assign it to the variable that is to represent the final output and then break the loop as the question asks for the first non-repeating character. The final output is then printed.