/**
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)
*/
class Solution {
public:
bool isValid(string s) {
//note the rules of a valid ip address
if (s.size() ==3 && (atoi(s.c_str()) ==0 || atoi(s.c_str()) > 255)) return false;
if (s.size() ==3 && s[0] == '0' ) return false;
if (s.size() ==2 && s[0] == '0' ) return false;
if (s.size() ==2 && atoi(s.c_str()) ==0) return false;
return true;
}
void getRes(vector