string형태의 IP address가 주어졌을 때 defanged version을 return한다.
(defanged version => replace very "." with "[.]")
class Solution:
def defangIPaddr(self, address: str) -> str:
return '[.]'.join(address.split('.'))
'👩💻Developer > Leetcode' 카테고리의 다른 글
[Easy][Python] Root Equals Sum of Children (0) | 2022.10.25 |
---|---|
[Easy][Python] Count of Matches in Tournament (0) | 2022.10.23 |
[Easy][Python] Build Array from Permutation (0) | 2022.10.23 |
[Easy][Python] Find Center of Star Graph (0) | 2022.10.22 |
[Easy][Python] Jewels and Stones (0) | 2022.10.22 |
댓글