LeetCode - Problems - Algorithms - 1108. Defanging an IP Address
Problem Description
Given a valid (IPv4) IP address, return a defanged version of that IP address.
A defanged IP address replaces every period "." with "[.]".
Example:
Constraints:
My Solution (Python)
class Solution(object):
def defangIPaddr(self, address):
"""
:type address: str
:rtype: str
"""
return address.replace(".", "[.]")
'Problem solving > Algorithms' 카테고리의 다른 글
[LeetCode] 1470. Shuffle the Array (Python) (0) | 2021.01.10 |
---|---|
[LeetCode] 1365. How Many Numbers Are Smaller Than the Current Number (Python) (0) | 2021.01.10 |
[LeetCode] 1431. Kids With the Greatest Number of Candies (Python) (0) | 2021.01.09 |
[LeetCode] 1672. Richest Customer Wealth (Python) (0) | 2021.01.09 |
[LeetCode] 1480. Running Sum of 1d Array (Python) (0) | 2021.01.09 |