Basic example
Input
s = "25525511135"
Output
['255.255.11.135', '255.255.111.35']
Two possible valid addresses.
Full lesson preview
Given a string of digits, produce all valid IPv4 addresses by inserting dots.
Problem statement
Task
Examples
Input
s = "25525511135"
Output
['255.255.11.135', '255.255.111.35']
Two possible valid addresses.
Input format
Output format
Constraints
Samples
Input
s = "0000"
Output
['0.0.0.0']
Each segment must be '0' (leading zeros not allowed otherwise).