当前位置:网站首页>PHP implementation extracts non repeated integers (programming topics can be the fastest familiar functions)
PHP implementation extracts non repeated integers (programming topics can be the fastest familiar functions)
2022-06-29 19:55:00 【Full stack programmer webmaster】
php Realization Extract non duplicate integers ( Programming topics can be the fastest to become familiar with functions )
One 、 summary
One sentence summary : Programming topics can be the fastest to become familiar with functions .
1、 String inversion function ?
No, str_revserse, Yes arr_reverse, Here is strrev
3 $num=strrev($num);
2、 String splitting function ( By fixed character )?
str_split()
4 $arr=str_split($num,1);
3、 Array to string function ?
implode()
6 $ans=implode($arr);
Two 、 Extract non duplicate integers
Title Description
Enter a int Type integer , Read right to left , Returns a new integer with no repeating numbers .
Input description :
Enter a int Type integer
Output description :
Read right to left , Returns a new integer with no repeating numbers
Example 1
Input
9876673
Output
37689
2、 Code
1 <?php
2 $num=trim(fgets(STDIN));
3 $num=strrev($num);
4 $arr=str_split($num,1);
5 $arr=array_unique($arr);
6 $ans=implode($arr);
7 echo $ans;
8 ?>
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/101599.html Link to the original text :https://javaforall.cn
边栏推荐
- Dynamics crm: among locally deployed servers, sandbox, unzip, VSS, asynchronous and monitor services
- Physical verification LVS process and Technology (Part I)
- 2022年深圳市福田区支持招商引资若干政策
- 社区访谈丨一个IT新人眼中的JumpServer开源堡垒机
- Notepad++--宏(记录操作过程)
- 从众伤害的是自己
- A keepalived high availability accident made me learn it again!
- npm ERR! fatal: early EOF npm ERR! fatal: index-pack failed
- 罗清启:高端家电已成红海?卡萨帝率先破局
- KDD 2022 | 协同过滤中考虑表征对齐和均匀性
猜你喜欢
做白银k线图有多重要?
Detailed description of gaussdb (DWS) complex and diverse resource load management methods
@Sneakythlows annotation
MySQL remote connection
Flume theory
How important is it to make a silver K-line chart?
Linux安装MySQL8
Configuration du Flume 4 - source personnalisée + sink
ASP. Net core creates razor page and uploads multiple files (buffer mode) (Continued)
Deficiencies and optimization schemes in Dao
随机推荐
nacos 问题
Performance improvement at the cost of other components is not good
2022年深圳市福田区支持先进制造业发展若干措施
2022年理财利率都降了,那该如何选择理财产品?
一次 Keepalived 高可用的事故,让我重学了一遍它!
CorelDRAW最新24.1.0.360版本更新介绍讲解
[software testing] 01 -- software life cycle and software development model
Koa 源码剖析
KDD 2022 | 協同過濾中考慮錶征對齊和均勻性
Detailed description of gaussdb (DWS) complex and diverse resource load management methods
Finally, Amazon~
剑指 Offer 41. 数据流中的中位数
如何设置 Pod 到指定节点运行
苹果iPhone手机升级系统内存空间变小不够如何解决?
14,04 millions! Appel d'offres pour la mise à niveau de la base de données relationnelle et du système logiciel Middleware du Département des ressources humaines et sociales de la province du Sichuan!
How to use filters in jfinal to monitor Druid for SQL execution?
Flume配置1——基础案例
What if the win11 policy service is disabled? Solution to disabling win11 policy service
ETCD数据库源码分析——服务端PUT流程
Sword finger offer 59 - I. maximum value of sliding window