[코테 풀이] Defanging an IP Address

시내·2024년 6월 10일
0

Q_1108) Defanging an IP Address

출처 : https://leetcode.com/problems/defanging-an-ip-address/

Given a valid (IPv4) IP address, return a defanged version of that IP address.

A defanged IP address replaces every period "." with "[.]".

class Solution {
    public String defangIPaddr(String address) {
      return  address.replace(".", "[.]");
    }
}
profile
contact 📨 ksw08215@gmail.com

0개의 댓글