当前位置:网站首页>Force deduction solution summary 1108-ip address invalidation
Force deduction solution summary 1108-ip address invalidation
2022-06-21 17:22:00 【Lost summer】
Directory links :
Force buckle programming problem - The solution sums up _ Share + Record -CSDN Blog
GitHub Synchronous question brushing items :
https://github.com/September26/java-algorithms
Original link : Power button
describe :
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 ".".
Example 1:
Input :address = "1.1.1.1"
Output :"1[.]1[.]1[.]1"
Example 2:
Input :address = "255.100.50.0"
Output :"255[.]100[.]50[.]0"
Tips :
Given address Is an effective IPv4 Address
source : Power button (LeetCode)
link :https://leetcode.cn/problems/defanging-an-ip-address
Copyright belongs to the network . For commercial reprint, please contact the official authority , Non-commercial reprint please indicate the source .
Their thinking :
* Their thinking : * One line of code to solve
Code :
public class Solution1108 {
public String defangIPaddr(String address) {
return address.replaceAll("\\.", "\\[\\.\\]");
}
}边栏推荐
猜你喜欢

Reinforcement learning introductory project spinning up (1) installation

Overseas new things | zoovu, an American AI startup, raised a new round of financing of US $169million to optimize the online "product discovery" experience for consumers

Fisher信息量检测对抗样本代码详解

Serialization and deserialization of binary tree

【Leetcode】297. 二叉树的序列化与反序列化 (困难)

Notice on the third national operation research / data, model and decision-making course teaching seminar in 2022

大话内存四区

Unittest框架的测试日志

建立自己的网站(11)

The release of autok3s v0.5.0 continues to be simple and friendly
随机推荐
[SQLite] résoudre le jeton non enregistré: ''
The beta version of move protocol is stable, and it is temporarily decided to expand the scale of the prize pool
Recruitment order | data visualization development platform "flyfish" and "super experience officer" are recruited!
Yaml数据驱动演示
Overseas new things | zoovu, an American AI startup, raised a new round of financing of US $169million to optimize the online "product discovery" experience for consumers
Unittest框架的测试日志
Oracle中实现获取指定行内容——Rownum和Row_number()
栈的生长方向和内存生长方向
Starkrocks Lecture 2 basic operation (1)
Disruptor local thread queue_ Workprocessor exception_ Fatalexceptionhandler--- inter thread communication work note 004
Postman基本操作
Pytest framework implements pre post processing
【mysql学习笔记14】DQL语句执行顺序
Interface automatic encryption and decryption
Alibaba cloud server + pagoda panel + no domain name deployment web project
【mysql学习笔记18】约束
The Google play academy team PK competition officially begins!
【mysql学习笔记19】多表查询
【mysql学习笔记17】常用函数整理
Use picgo core and Alibaba cloud to automatically upload typera pictures