Skip to content

Commit 919ff08

Browse files
committed
Runtime: 2 ms (Top 45.49%) | Memory: 5.9 MB (Top 68.62%)
1 parent a2e06fc commit 919ff08

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
// Runtime: 2 ms (Top 45.49%) | Memory: 5.9 MB (Top 68.62%)
12
class Solution {
23
public:
34
string defangIPaddr(string address) {
45
string res;
56
for(int i=0;i<address.length();i++){
67
if(address[i]=='.'){
78
res+="[.]";
8-
9+
910
}
1011
else{
1112
res+=address[i];
1213
}
1314
}
1415
return res;
1516
}
16-
};
17+
};

0 commit comments

Comments
 (0)