当前位置:网站首页>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
9876673Output
376892、 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
边栏推荐
- With these four security testing tools, software security testing can be said so easy!
- 【观察】软通动力刘天文:拥抱变化“顺势而为”,做中国数字经济“使能者”...
- 剑指 Offer 59 - I. 滑动窗口的最大值
- Chapter II (physical layer)
- 雪花id,分布式唯一id
- Inception 新结构 | 究竟卷积与Transformer如何结合才是最优的?
- Performance improvement at the cost of other components is not good
- 一小时构建示例场景 声网发布灵隼物联网云平台
- JVM (4) bytecode technology + runtime optimization
- KDD 2022 | characterization alignment and uniformity are considered in collaborative filtering
猜你喜欢

Exploration and practice of NLP problem modeling scheme

As the "only" privacy computing provider, insight technology is the "first" to settle in the Yangtze River Delta data element circulation service platform

Linux Installation mysql5

How important is it to make a silver K-line chart?

Common knowledge of ECS security settings

JVM(4) 字节码技术+运行期优化

Win11 system component cannot be opened? Win11 system widget cannot be opened solution

3-2 host discovery - layer 3 discovery

通过MeterSphere和DataEase实现项目Bug处理进展实时跟进

MySQL remote connection
随机推荐
What if the win11 policy service is disabled? Solution to disabling win11 policy service
Koa 源码剖析
Where is the win11 installation permission set? Win11 installation permission setting method
文件包含漏洞
命令执行(RCE)漏洞
What about frequent network disconnection of win11 system? Solution to win11 network instability
Static static member variables use @value injection
一次 Keepalived 高可用的事故,让我重学了一遍它!
Union find
2022年深圳市福田区支持先进制造业发展若干措施
How to set a pod to run on a specified node
How to install and use computer SSD hard disk
Mba-day19 if P then q contradictory relation P and not Q
雪花id,分布式唯一id
Test method learning
QC protocol + Huawei fcp+ Samsung AFC fast charging 5v9v chip fs2601 application
7. cancellation and closing
Freemaker template framework generates images
14.04 million! Sichuan provincial human resources and social security department relational database and middleware software system upgrade procurement bidding!
Flutter calls Baidu map app to realize location search and route planning