Amazon Interview Question

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