close
Given a valid (IPv4) IP address, return a defanged version of that IP address. A defanged IP address replaces every period "." with "[.]". 解題方法:用python 很直覺的就想到用replace替代.為[.],不知道這題有什麼比較高端的方法
class Solution: def defangIPaddr(self, address: str) -> str: return address.replace(".","[.]")
文章標籤
全站熱搜
留言列表