bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
EasyArrays & HashingLC 1108

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 "[.] ".

Asked at 6 companies
AdobeAmazonApple
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode