题解 | #找出字符串中第一个只出现一次的字符#

找出字符串中第一个只出现一次的字符

http://www.nowcoder.com/practice/e896d0f82f1246a3aa7b232ce38029d4

while True: try: s = input() target_list = [] for i in s: if s.count(i) == 1: target_list.append(i) if len(target_list) == 0: print(-1) else: print(target_list[0]) except: break

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务