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

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

&nbsp;
Example 1:
Input: address = "1.1.1.1"
Output: "1[.]1[.]1[.]1"
Example 2:
Input: address = "255.100.50.0"
Output: "255[.]100[.]50[.]0"

&nbsp;
Constraints:


	The given address is a valid IPv4 address.

class Solution:
	def defangIPaddr(self, address: str) -> str:
		return address.replace('.', '[.]')
class Solution {
    public String defangIPaddr(String address) {
        return address.replace(".","[.]");
    }
}
class Solution {
public:
    string defangIPaddr(string address) {
     string res;
        for(int i=0;i<address.length();i++){
         if(address[i]=='.'){
             res+="[.]";

         }
        else{
                res+=address[i];
            }
     }
        return res;
    }
};
var defangIPaddr = function(address) {
   return address.split("").map((x)=>{
        if(x=='.')
            return "[.]"
        else return x
    }).join("")
};
Defanging an IP Address