Restore IP Addresses
Try to solve the Restore IP Addresses problem.
We'll cover the following
Statement
Given that a string, s
, contains digits, return a list of all possible valid IP addresses that can be obtained from the string.
Note: The order in which IP addresses are placed in the list is not important.
A valid IP address is made up of four numbers separated by dots .
, for example, . Each number falls between and (including and ), and none of them can have leading zeros.
Constraints:
-
The input string
s
consists of digits only. -
s.length
Examples
Create a free account to view this lesson.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy