Skip to content

Commit 4649b9c

Browse files
committed
feat: add typescript solution to lc problem: No.1108.Defanging an IP Address
1 parent 6c201a8 commit 4649b9c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

solution/1100-1199/1108.Defanging an IP Address/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ class Solution {
6161
}
6262
```
6363

64+
### **TypeScript**
65+
66+
```ts
67+
function defangIPaddr(address: string): string {
68+
return address.split('.').join('[.]');
69+
};
70+
```
71+
6472
### **C++**
6573

6674
```cpp

solution/1100-1199/1108.Defanging an IP Address/README_EN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ class Solution {
6060
}
6161
```
6262

63+
### **TypeScript**
64+
65+
```ts
66+
function defangIPaddr(address: string): string {
67+
return address.split('.').join('[.]');
68+
};
69+
```
70+
6371
### **C++**
6472

6573
```cpp
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function defangIPaddr(address: string): string {
2+
return address.split('.').join('[.]');
3+
};

0 commit comments

Comments
 (0)