当前位置:网站首页>提取不重复的整数
提取不重复的整数
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
边栏推荐
- Common interview questions of operating system:
- How to test mobile app?
- 控制结构(一)
- [backtrader source code analysis 18] Yahoo Py code comments and analysis (boring, interested in the code, you can refer to)
- Nacos program connects to mysql8 0+ NullPointerException
- The wechat applet optimizes the native request through the promise of ES6
- Mobile finance (for personal use)
- Baidu written test 2022.4.12 + programming topic: simple integer problem
- Cookie&Session
- Explanation of redis database (IV) master-slave replication, sentinel and cluster
猜你喜欢

Detailed explanation of kubernetes (XI) -- label and label selector

网站压测工具Apache-ab,webbench,Apache-Jemeter

setcontext getcontext makecontext swapcontext

T2 iCloud日历无法同步

Krpano panorama vtour folder and tour

让阿里P8都为之着迷的分布式核心原理解析到底讲了啥?看完我惊了

Explanation 2 of redis database (redis high availability, persistence and performance management)

Mysql database explanation (IX)

Mysql连接查询详解

网站建设与管理的基本概念
随机推荐
YML references other variables
adobe illustrator 菜单中英文对照
Knn,Kmeans和GMM
Explanation of redis database (III) redis data type
T2 iCloud日历无法同步
【Leetcode-每日一题】安装栅栏
G007-hwy-cc-estor-03 Huawei Dorado V6 storage simulator construction
MySQL InnoDB transaction
[leetcode daily question] install fence
How to design a good API interface?
adobe illustrator 菜單中英文對照
Multitimer V2 reconstruction version | an infinitely scalable software timer
自主作业智慧农场创新论坛
How did the computer reinstall the system? The display has no signal
网站某个按钮样式爬取片段
Mysql database explanation (IX)
What are the mobile app software testing tools? Sharing of third-party software evaluation
【递归之数的拆分】n分k,限定范围的拆分
使用 Bitnami PostgreSQL Docker 镜像快速设置流复制集群
c语言---字符串+内存函数