Java solution with a simple predicate
\nclass Solution {\n    private Predicate<String> coordinatePredicate =\n            s -> !(s.contains(".") && s.endsWith("0") || s.startsWith("0") && s.length(
```\nclass Solution {\n    private Predicate<String> coordinatePredicate =\n            s -> !(s.contains(".") && s.endsWith("0") || s.startsWith("0") && s.length() > 1 && !s.startsWith("0."));\n\n    private String removeParentheses(String s) {\n        return s.substring(1, s.length() - 1);\n    }\n\n    public List<String> ambiguousCoordinates(String S) {\n        List<String> result = new ArrayList<>();\n        S = removeParentheses(S);\n        for (int i = 1; i < S.length(); i++) {\n            result.addAll(combine(\n                    possibleCoordinates(S.substring(0, i)),\n                    possibleCoordinates(S.substring(i))\n            ));\n        }\n        return result;\n    }\n\n    private List<String> possibleCoordinates(String s) {\n        return IntStream.range(0, s.length())\n                .mapToObj(i -> insertDot(s, i))\n                .filter(coordinatePredicate)\n                .collect(Collectors.toList());\n    }\n\n    private static String insertDot(String val, int place) {\n        if (place == 0) {\n            return val;\n        }\n        return val.substring(0, place) + "." + val.substring(place);\n    }\n\n    private static List<String> combine(List<String> l1, List<String> l2) {\n        return l1.stream().flatMap(s1 -> l2.stream().map(s2 -> "(" + s1 + ", " + s2 + ")")).collect(Collectors.toList());\n    }\n}\n```
[]