Not a good question. Intuitive solution.
Intuition\nThis is the worst kind of questions on Leetcode. It has nothing to do with any algorithm or data structure worth practicing, but adds layers and laye
# Intuition\nThis is the worst kind of questions on Leetcode. It has nothing to do with any algorithm or data structure worth practicing, but adds layers and layers of difficulties that are tricky to resolve. \n\nSo basically the idea is to split the string into two parts, convert each part into an acceptable form and combine. For example, for "123456" we can split the string into ```1,23456```, ```12,3456```, ```123,456```,```1234,56```, ```12345,6```. Then we start to add decimal points on left and right part. \n\n# Approach\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public List<String> ambiguousCoordinates(String s) {\n        return helper(s.substring(1, s.length()-1));\n    }\n\n    List<String> helper(String s){\n\n        List<String> res = new ArrayList();\n\n        for(int i=1 ; i<s.length(); i++){\n\n            String leftPart = s.substring(0, i);\n            String rightPart = s.substring(i);\n\n            if(consecZero(leftPart)||consecZero(rightPart)) continue;\n            \n            List<String> left = addDot(leftPart);\n            List<String> right = addDot(rightPart);\n\n            for(String l: left){\n                for(String r: right){\n                    \n                    // System.out.println(l+",,,"+r);\n                    String newString = "("+l+", "+r+")";\n\n                    res.add(newString);\n\n                }\n            }\n\n        }\n\n        return res;\n\n    }\n\n    boolean consecZero(String s){\n        if(s.length()==1) return false;\n\n        for(int i=0; i<s.length(); i++){\n\n            if(s.charAt(i)!=\'0\') return false;\n\n        }\n    return true;\n    }\n\n    List<String> addDot(String s){\n        // System.out.println(s+"...");\n        if(s.length()==1) {\n            List<String> res= new ArrayList();\n            res.add(s);\n            return res; \n        }\n\n        List<String> res = new ArrayList();\n         \n\n        if(s.startsWith("0")) {\n            String ele = s.substring(0, 1)+"."+s.substring(1);\n            if(isValid(ele))\n            res.add(ele);\n            return res;\n        } else {\n             res.add(s);\n            //  System.out.println("ff");\n            for(int i=1; i<s.length(); i++){\n                String ele = s.substring(0, i)+"."+s.substring(i);\n                // System.out.println("..ele"+ele);\n                if(isValid(ele))\n                res.add(ele);\n            }\n\n        }\n        return res;\n    }\n\n    boolean isValid(String s){\n      return s.charAt(s.length()-1)!=\'0\';\n    }\n}\n```
['Java']