C++ clean and short codes
\nchar buf[14];\nclass Solution {\npublic:\n    inline bool check(const char *c, int n) {\n        return 1==n||c[0]!=\'0\'||c[n-1]!=\'0\';\n    }\n    vector<s
```\nchar buf[14];\nclass Solution {\npublic:\n    inline bool check(const char *c, int n) {\n        return 1==n||c[0]!=\'0\'||c[n-1]!=\'0\';\n    }\n    vector<string> helper (const char *c, int n) {\n        vector<string> ans;\n        if(n==1) {\n            ans.push_back(string(c, 1));\n            return move(ans);\n        }\n        if(c[0]==\'0\') {\n            buf[0]=\'0\';\n            buf[1]=\'.\';\n            for(int i=1; i<n; ++i) {\n                buf[i+1]=c[i];\n            }\n            buf[n+1]=\'\\0\';\n            ans.push_back(buf);\n        } else if(c[n-1]==\'0\'){\n            ans.push_back(string(c,n));\n        } else {\n            for(int i=0; i<n; ++i) {\n                buf[i]=c[i];\n            }\n            buf[n]=\'\\0\';\n            buf[n+1]=\'\\0\';\n            ans.push_back(buf);\n            buf[n]=\'.\';\n            for(int i=n-1; i>0; --i){\n                swap(buf[i], buf[i+1]);\n                ans.push_back(buf);\n            }\n        }\n        return move(ans);\n    }\n    vector<string> ambiguousCoordinates(string s) {\n        int N=s.size()-2;\n        const char * c =s.c_str()+1;\n        string str("(");\n        vector<string> ans;\n        for(int i=0; i<N-1; ++i) {\n            // cout<<string(c, i+1)<<":"<<check(c, i+1)<<" | "\n            //     <<string(c+i+1, N-i-1)<<":"<<check(c+i+1, N-i-1)<<"\\n";\n            if(check(c, i+1) && check(c+i+1, N-i-1)) {\n                auto left=helper(c, i+1);\n                auto right=helper(c+i+1, N-i-1);\n                for(auto &l:left) {\n                    for(auto &r:right) {\n                        ans.push_back(str+l+", "+r+")");\n                    }\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
[]