题解 | #提取不重复的整数#
提取不重复的整数
http://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
inNumber = input().strip() out = '' #从字符串尾部开始遍历,遇到出现过的数字则跳过 nums =[] for i in range(len(inNumber)-1,-1,-1): if inNumber[i] in nums: continue else: out = out + inNumber[i] nums.append(inNumber[i]) print(out)