483. Defang an IP Address
EasyString
Replace every "." in the IPv4 address with "[.]".
Input format
One IPv4 address
Output format
The defanged address.
Example 1
Input
1.1.1.1
Output
1[.]1[.]1[.]1
Example 2
Input
255.100.50.0
Output
255[.]100[.]50[.]0
Constraints
A valid IPv4 address.
Read input from standard input and print the answer to standard output. Your code is judged against 3 test cases, most of them hidden.
Loading the MyLoginn IDE…