Valid ip address reconstruction
Your task
Given a string s of digits, return all possible valid IPv4 addresses that can be formed by inserting three dots into s without reordering or removing any digit. A valid segment is 0-255 with no leading zeros (so '0' is valid but '01' and '00' are not). Return the addresses sorted lexicographically. The length of s is between 0 and 12.
Examples
restore_ip_addresses(s: str) -> list[str]Example 1
Input
restore_ip_addresses("25525511135")Output
["255.255.11.135", "255.255.111.35"]