当前位置:网站首页>提取不重复的整数
提取不重复的整数
2022-04-23 15:34:00 【叶宁夏昕】
描述
输入一个 int 型整数,按照从右向左的阅读顺序,返回一个不含重复数字的新的整数。
保证输入的整数最后一位不是 0 。
数据范围:1≤n≤10^8
输入描述:
输入一个int型整数
输出描述:
按照从右向左的阅读顺序,返回一个不含重复数字的新的整数
示例1
输入:9876673
输出:37689
a = int(input())
b = a[::-1]
list = []
for i in b:
if i in list:
continue
else:
list.append(i)
print(i,end='')
a[:-1]与a[::-1]区别
版权声明
本文为[叶宁夏昕]所创,转载请带上原文链接,感谢
https://blog.csdn.net/come_bn/article/details/124305429
边栏推荐
- Detailed explanation of kubernetes (IX) -- actual combat of creating pod with resource allocation list
- Deeply learn the skills of parameter adjustment
- 编译,连接 -- 笔记
- Pytorch中named_parameters、named_children、named_modules函数
- After time judgment of date
- Machine learning - logistic regression
- What if the server is poisoned? How does the server prevent virus intrusion?
- Advantages, disadvantages and selection of activation function
- 移动app测试如何进行?
- Crawling fragment of a button style on a website
猜你喜欢
随机推荐
调度系统使用注意事项
Educational Codeforces Round 127 A-E题解
2022年中国数字科技专题分析
【AI周报】英伟达用AI设计芯片;不完美的Transformer要克服自注意力的理论缺陷
Advantages, disadvantages and selection of activation function
Hj31 word inversion
Modify the default listening IP of firebase emulators
机器学习——逻辑回归
CVPR 2022 优质论文分享
Go语言切片,范围,集合
考试考试自用
自主作业智慧农场创新论坛
How to test mobile app?
Elk installation
C language super complete learning route (collection allows you to avoid detours)
怎么看基金是不是reits,通过银行购买基金安全吗
Mysql database explanation (VII)
The wechat applet optimizes the native request through the promise of ES6
Comparaison du menu de l'illustrateur Adobe en chinois et en anglais
Baidu written test 2022.4.12 + programming topic: simple integer problem