题解 | #找出字符串中第一个只出现一次的字符#
找出字符串中第一个只出现一次的字符
http://www.nowcoder.com/practice/e896d0f82f1246a3aa7b232ce38029d4
找出字符串中第一个只出现一次的字符
while True:
try:
st = input()
z = [chr(i).lower() for i in range(65,91)]
I = []
for i in z:
if st.count(i) == 1:
I.append(i)
if len(I) == 0:
print('-1')
flag = 0
for j in st:
for c in I:
if j == c:
flag = 1
break
if j == c:
flag = 1
break
if flag == 1:
print(j)
except:
break