题解 | #找出字符串中第一个只出现一次的字符#
找出字符串中第一个只出现一次的字符
https://www.nowcoder.com/practice/e896d0f82f1246a3aa7b232ce38029d4
str = input()
lcount = -1 # 如果不存在,输出-1
# 遍历位置
for i in range(len(str)):
if str.count(str[i]) == 1:
lcount = str[i]
break
print(lcount)
安克创新 Anker公司福利 743人发布
查看22道真题和解析

