Amazon Coding Interview Question - firstNonRepeatingCharacter