mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
update
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
<p>Given a valid (IPv4) IP <code>address</code>, return a defanged version of that IP address.</p>
|
||||
|
||||
<p>A <em>defanged IP address</em> replaces every period <code>"."</code> with <code>"[.]"</code>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<pre><strong>Input:</strong> address = "1.1.1.1"
|
||||
<strong>Output:</strong> "1[.]1[.]1[.]1"
|
||||
</pre><p><strong>Example 2:</strong></p>
|
||||
<pre><strong>Input:</strong> address = "255.100.50.0"
|
||||
<strong>Output:</strong> "255[.]100[.]50[.]0"
|
||||
</pre>
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li>The given <code>address</code> is a valid IPv4 address.</li>
|
||||
<p>Given a valid (IPv4) IP <code>address</code>, return a defanged version of that IP address.</p>
|
||||
|
||||
|
||||
|
||||
<p>A <em>defanged IP address</em> replaces every period <code>"."</code> with <code>"[.]"</code>.</p>
|
||||
|
||||
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre><strong>Input:</strong> address = "1.1.1.1"
|
||||
|
||||
<strong>Output:</strong> "1[.]1[.]1[.]1"
|
||||
|
||||
</pre><p><strong>Example 2:</strong></p>
|
||||
|
Reference in New Issue
Block a user