Defanging an IP Address Leetcode Solution

Problem Statement In this problem, we are given an IP Address. We just have to convert it into a Defanged IP Address i.e. in our output string, all the “.” are converted to “[.]”. Example #1: address = “1.1.1.1” “1[.]1[.]1[.]1” #2: address = “255.100.50.0” “255[.]100[.]50[.]0” Approach 1 (Using String Stream/Builder) …

Read more

StringBuffer in Java

StringBuffer class in Java The StringBuffer in Java is a class that we can use to manipulate Strings. Strings are immutable which means it is of fixed length whereas StringBuffer is mutable and growable meaning we can change the length of string and do different manipulations like append, delete, insert, …

Read more

Translate ยป