private void findIps(String s, int start, int remainingParts, StringBuilder result, List<String> results) {
        int maxLen = remainingParts * 3;
        int remainingLen = s.length() - start;
        if (remainingLen > maxLen || remainingLen < remainingParts) {
            return;
        }

        if (remainingParts == 1) {
            String part = getIpPart(s, start, s.length());
            if (part != null) {
                result.append('.').append(part);

                results.add(result.toString());
            }
        } else {
            for (int i = 1; i <= 3; i++) {
                if (start + i > s.length()) {
                    continue;
                }

                String part = getIpPart(s, start, start + i);
                if (part != null) {
                    StringBuilder newResult = new StringBuilder(result);
                    if (newResult.length() > 0) {
                        newResult.append('.');
                    }
                    newResult.append(part);

                    findIps(s, start + i, remainingParts - 1, newResult, results);
                }
            }
        }
    }