Bhayank code h bhai! C++
c++\nclass Solution {\npublic:\n    bool valpre(string &s){\n        if(s.size()==1) return true;\n        if(s[0]==\'0\') return false;\n        return true;\n
```c++\nclass Solution {\npublic:\n    bool valpre(string &s){\n        if(s.size()==1) return true;\n        if(s[0]==\'0\') return false;\n        return true;\n    }\n    bool valsuff(string &s){\n        if(s[s.size()-1]==\'0\') return false;\n        return true;\n    }\n    bool isvalid(string &s){\n        if(s.size()==1) return true;\n        int i = 0;\n        string pre = "";\n        string suff = "";\n        while(i<s.size()&&s[i]!=\'.\'){\n            pre+=s[i];\n            i++;\n        }\n        if(i==s.size()){\n            if(s[0]==\'0\') return false;\n            return true;\n        }\n        suff = s.substr(i,s.size());\n        return valpre(pre)&&valsuff(suff);\n        \n    }\n    vector<string>make_coordinate(string &s){\n        vector<string>res;\n        res.push_back(s);\n        if(s.size()==1) return res;\n        string prefix = "";\n        string suffix = "";\n        for(int i = 0;i<s.size()-1;i++){\n            prefix+=s[i];\n            suffix = s.substr(i+1,s.size());\n            if(suffix.size()==0){\n                res.push_back(prefix);\n                continue;\n            }\n            string curr = "";\n            curr+=prefix;\n            curr+=\'.\';\n            curr+=suffix;\n            res.push_back(curr);\n        }\n        return res;\n    }\n    vector<string> ambiguousCoordinates(string s) {\n        s.erase(s.begin());\n        s.erase(--s.end());\n        string prefix = "";\n        string suffix;\n        vector<string>ans;\n        string temp = "01";\n        for(int i = 0;i<s.size()-1;i++){\n            prefix+=s[i];\n            suffix = s.substr(i+1,s.size());\n            vector<string>leftcord = make_coordinate(prefix);\n            vector<string>rightcord = make_coordinate(suffix);\n            for(auto &s1 : leftcord){\n                for(auto &s2 : rightcord){\n                    if(isvalid(s1)==false||isvalid(s2)==false) continue;\n                    string curr = "(";\n                    curr+=s1;\n                    curr+=", ";\n                    curr+=s2;\n                    curr+=\')\';\n                    ans.push_back(curr);\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
[]