Microsoft Interview Question

Return first non repeating character in a string and then optimize it.