Write a program to find the first non-repeating character in a given string and analyze its time complexity.