Given a string containing only digits, restore it by returning all possible valid IP address combinations.
Example:
Input: "25525511135"
Output: ["255.255.11.135", "255.255.111.35"]
题意
给定一个没加点的IP地址,返回所有可能的合法IP地址。
思路:DFS
代码
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
Example:
Input: "25525511135"
Output: ["255.255.11.135", "255.255.111.35"]
题意
给定一个没加点的IP地址,返回所有可能的合法IP地址。
思路:DFS
代码