解题思路就是使用哈希表结构按照顺序对字母进行计数。然后根据计数结果,首次出现的字母会被输出;没有只出现过一次的字母,打印-1

while True:
    try:
        s = input()
    except:
        break
    letter = []
    count_list = []
    for c in s:
        if c in letter:
            count_list[letter.index(c)] += 1
        else:
            letter.append(c)
            count_list.append(1)
    try:
        index = count_list.index(1)
        print(letter[index])
    except:
        print(-1)