rustgym 0.2.0

rustgym solutions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
struct Solution;

impl Solution {
    fn defang_i_paddr(address: String) -> String {
        address.replace(".", "[.]")
    }
}

#[test]
fn test() {
    let address = "1.1.1.1".to_string();
    let res = "1[.]1[.]1[.]1".to_string();
    assert_eq!(Solution::defang_i_paddr(address), res);
    let address = "255.100.50.0".to_string();
    let res = "255[.]100[.]50[.]0".to_string();
    assert_eq!(Solution::defang_i_paddr(address), res);
}