Implement a function to find the first non-repeating character in a string and discuss its complexity.