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)思路:DFS。只需增加判断每个部分数字在0到255之间,并且第一位数不能是0.另外代码中用到string转int的方法,先利用c_s 阅读全文
posted @ 2013-11-13 18:25 waruzhi 阅读(183) 评论(0) 推荐(0) 编辑