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

Next Greater Element I Leetcode Solution

Problem Statement In this problem, we are given two lists in which first list is subset of second list. For each element of first list, we have to find out next greater element in the second list. Example nums1 = [4,1,2], nums2 = [1,3,4,2] [-1,3,-1] Explanation: for first element of list1 i.e. for 4 there …

Read more

Minimum Time Visiting All Points Leetcode Solution

The problem Minimum Time Visiting All Points Leetcode Solution provides us with an array or vector of points on coordinate axes. The problem after providing us with the input asks us to find the minimum time to visit all the points given in the input. When you move one unit …

Read more

Translate »