当前位置:网站首页>提取不重复的整数
提取不重复的整数
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
边栏推荐
- Mysql database explanation (8)
- Knn,Kmeans和GMM
- Detailed explanation of kubernetes (IX) -- actual combat of creating pod with resource allocation list
- 字节面试 transformer相关问题 整理复盘
- 函数(第一部分)
- Summary of interfaces for JDBC and servlet to write CRUD
- 通過 PDO ODBC 將 PHP 連接到 MySQL
- Deeply learn the skills of parameter adjustment
- Grep was unable to redirect to the file
- 【AI周报】英伟达用AI设计芯片;不完美的Transformer要克服自注意力的理论缺陷
猜你喜欢

MultiTimer v2 重构版本 | 一款可无限扩展的软件定时器

pgpool-II 4.3 中文手册 - 入门教程

Sorting and replying to questions related to transformer

setcontext getcontext makecontext swapcontext

Mysql database explanation (IX)

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

Detailed explanation of MySQL connection query

cadence SPB17.4 - Active Class and Subclass

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

Recommended search common evaluation indicators
随机推荐
网站某个按钮样式爬取片段
Use of common pod controller of kubernetes
Crawling fragment of a button style on a website
深度学习调参的技巧
字节面试 transformer相关问题 整理复盘
kubernetes之常用Pod控制器的使用
JSON date time date format
【Leetcode-每日一题】安装栅栏
Connect PHP to MSSQL via PDO ODBC
Example of time complexity calculation
Special analysis of China's digital technology in 2022
redis-shake 使用中遇到的错误整理
For examination
My raspberry PI zero 2W toss notes to record some problems and solutions
Deeply learn the skills of parameter adjustment
Grep was unable to redirect to the file
fatal error: torch/extension. h: No such file or directory
C language super complete learning route (collection allows you to avoid detours)
机器学习——逻辑回归
Modify the default listening IP of firebase emulators