We’re preparing your current view and syncing the latest data.
Given a string containing only digits, return all possible valid IP address combinations that can be formed by inserting dots into the string. A valid IP address consists of exactly four integers (each integer is between 0 and 255) separated by single dots and cannot have leading zeros except the number 0 itself. Return the IP addresses in any order.
A single string s containing only digits.
An array of strings representing all possible valid IP addresses that can be formed from s.
1 <= s.length <= 20
Example 1
Input
"25525511135"
Output
["255.255.11.135","255.255.111.35"]
Explanation
These are the only valid IP addresses that can be formed from the input string.