Skip to content

Latest commit

 

History

History
 
 

0093.restore-ip-addresses

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

题目

Given a string containing only digits, restore it by returning all possible valid IP address combinations.

For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.35"]. (Order does not matter)

解题思路

见程序注释

下次做此题,不要用 DFS 方法。普通的递归更快。