https://leetcode.com/problems/restore-ip-addresses/
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)
Keywords: ALL POSSIBLE gives us hint to use DFS
Another important point is that we should eliminate the case like '00', '01', '001', etc.
1 |
|