当前位置:网站首页>"Daily practice, happy water" 1108 IP address invalidation
"Daily practice, happy water" 1108 IP address invalidation
2022-06-25 04:42:00 【Who eats mints】
List of articles
Try to catch up with the original question :
* A brief introduction to the topic :
Give you an effective IPv4 Address address, Go back to this IP Invalid version of address .
The so-called invalidation IP Address , In fact, it is to use “[.]” Instead of every “.”.
* Their thinking :
- Simulation Dafa is good
- Traversal string , hold
.Replace with[.]that will do - over
*C++ Code :
class Solution {
public:
string defangIPaddr(string address) {
string ans;
for (auto c : address) {
if (c == '.') {
ans += "[.]";
} else {
ans.push_back(c);
}
}
return ans;
}
};
Result display :

边栏推荐
猜你喜欢

高效的NoSQL数据库服务Amozon DynamoDB体验分享

【esp32学习之路6——flash加密】

cnpm : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。

2.0springmvc uses restful

Musk released humanoid robot. Why is AI significant to musk?

记录小知识点

LabVIEW开发气体调节器

机器学习深度学习——向量化

Machine learning deep learning -- Vectorization

【FLink】access closed classloader classloader.check-leaked-classloader
随机推荐
PostgreSQL数据库WAL——RM_HEAP_ID日志记录动作
CTF_ Web: Advanced questions of attack and defense world expert zone WP (9-14)
Le chemin de l'apprentissage immutable - - Adieu à la copie traditionnelle
微信小程序父子组件之间传值
Basic introduction of gbase 8s blocking technology
Upgrade PHP to php7 The impact of X (2), the obsolescence of mcrypt decryption
OOP 向量加减(友元+拷贝构造)
大话云原生数据库中的存算分离
Vscode 设置clang-format
Trigger for gbase 8s
CTF_ Web: deserialization learning notes (I) classes and objects in PHP
使用文本分析识别一段文本中的主要性别
我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶
成功解决:selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from
Gbase 8s overall architecture
Data view for gbase 8s
515. find the maximum value / Sword finger offer II 095 in each tree row Longest common subsequence
The solution of wechat applet switchtab unable to take parameters
GBASE 8s的并行操作问题场景描述
What is persistence? What are RDB and AOF in redis persistence?