Defanging an IP Address

Problem Id: 1108 Difficulty: Easy


Intuition

Solution


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