当前位置:网站首页>提取不重复的整数
提取不重复的整数
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
边栏推荐
- Explanation of redis database (III) redis data type
- Educational Codeforces Round 127 A-E题解
- Analysis of common storage types and FTP active and passive modes
- Grep was unable to redirect to the file
- Connect PHP to MySQL via PDO ODBC
- Go语言数组,指针,结构体
- Krpano panorama vtour folder and tour
- 群体智能自主作业智慧农场项目启动及实施方案论证会议
- 深度学习——超参数设置
- Go语言切片,范围,集合
猜你喜欢
Detailed explanation of MySQL connection query
KNN, kmeans and GMM
Wechat applet customer service access to send and receive messages
群体智能自主作业智慧农场项目启动及实施方案论证会议
Sorting and replying to questions related to transformer
How did the computer reinstall the system? The display has no signal
Kubernetes详解(九)——资源配置清单创建Pod实战
How to design a good API interface?
Special analysis of China's digital technology in 2022
cadence SPB17. 4 - Active Class and Subclass
随机推荐
山寨版归并【上】
函数(第一部分)
Deep learning - Super parameter setting
Sorting and replying to questions related to transformer
Recommended search common evaluation indicators
移动金融(自用)
网站压测工具Apache-ab,webbench,Apache-Jemeter
What if the server is poisoned? How does the server prevent virus intrusion?
How to test mobile app?
Openstack theoretical knowledge
MySQL sync could not find first log file name in binary log index file error
Compiling OpenSSL
Common types of automated testing framework ▏ automated testing is handed over to software evaluation institutions
Advantages, disadvantages and selection of activation function
Special analysis of China's digital technology in 2022
PHP PDO ODBC loads files from one folder into the blob column of MySQL database and downloads the blob column to another folder
怎么看基金是不是reits,通过银行购买基金安全吗
通过 PDO ODBC 将 PHP 连接到 MSSQL
MultiTimer v2 重构版本 | 一款可无限扩展的软件定时器
网站某个按钮样式爬取片段