1108. Defanging an IP Address

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1108

class Solution:
    def defangIPaddr(self, address: str) -> str:
        return address.replace('.', '[.]')