public static void restoreIpAddressesHelper(String s,
			ArrayList<String> list, ArrayList<ArrayList<String>> resultLists) {
		if (s.length() > 12) {
			return;
		}
		if (s.length() == 0) {
			resultLists.add(list);
			return;
		}
		// less than
		if (s.length() >= 1) {
			ArrayList<String> newList = copyArrayList(list);
			newList.add(s.substring(0, 1));
			restoreIpAddressesHelper(s.substring(1), newList, resultLists);
		}
		if (s.length() >= 2) {
			ArrayList<String> newList = copyArrayList(list);
			newList.add(s.substring(0, 2));
			restoreIpAddressesHelper(s.substring(2), newList, resultLists);
		}
		if (s.length() >= 3 && Integer.parseInt(s.substring(0, 3)) <= 255) {
			ArrayList<String> newList = copyArrayList(list);
			newList.add(s.substring(0, 3));
			restoreIpAddressesHelper(s.substring(3), newList, resultLists);
		}
		return;
	}