1108. Defanging an IP Address Easy
1/**
2 * [1108] Defanging an IP Address
3 *
4 * Given a valid (IPv4) IP address, return a defanged version of that IP address.
5 *
6 * A defanged IP address replaces every period "." with "[.]".
7 *
8 *
9 * Example 1:
10 * Input: address = "1.1.1.1"
11 * Output: "1[.]1[.]1[.]1"
12 * Example 2:
13 * Input: address = "255.100.50.0"
14 * Output: "255[.]100[.]50[.]0"
15 *
16 *
17 * Constraints:
18 *
19 *
20 * The given address is a valid IPv4 address.
21 *
22 */
23pub struct Solution {}
24
25// problem: https://leetcode.com/problems/defanging-an-ip-address/
26// discuss: https://leetcode.com/problems/defanging-an-ip-address/discuss/?currentPage=1&orderBy=most_votes&query=
27
28// submission codes start here
29
30impl Solution {
31 pub fn defang_i_paddr(address: String) -> String {
32 String::new()
33 }
34}
35
36// submission codes end
37
38#[cfg(test)]
39mod tests {
40 use super::*;
41
42 #[test]
43 fn test_1108() {
44 }
45}
46
Back
© 2025 bowen.ge All Rights Reserved.