2573. Find the String with LCP
\nclass Solution {\npublic:\n    string findTheString(vector<vector<int>>& lcp) {\n       int n= lcp.size();\n       string ans ="";\n       if(lcp[0][0]!=n)\n 
```\nclass Solution {\npublic:\n    string findTheString(vector<vector<int>>& lcp) {\n       int n= lcp.size();\n       string ans ="";\n       if(lcp[0][0]!=n)\n       return ans;\n\n       for(int i=0;i<n;i++){\n           for(int j=0;j<n;j++){\n               if(lcp[i][j]!=lcp[j][i]||lcp[i][j]>n-max(i,j))\n               return ans;\n               if(i+1<n && j+1<n && lcp[i][j]>0 && lcp[i+1][j+1]!=lcp[i][j]-1)\n            return ans;\n           }\n       }\n\n       int t=0;\n       for(int i=0;i<n;i++)\n       ans +=\'1\';\n\n       for(int i=0;i<n;i++){\n           bool flag = false;\n           for(int j=i;j<n;j++){\n               if(ans[j]==\'1\' && lcp[i][j]!=0){\n                   if(t>=26)\n                   return "";\n                   ans[j] =\'a\'+t;\n                   flag = true;\n               }\n           }\n           if(flag ==true)\n           t++;\n       }\n\n       for(int i=0;i<n;i++){\n           for(int j=0;j<n;j++){\n               if(lcp[i][j]!=0 && ans[i]!=ans[j])\n               return "";\n           }\n       }\n       return ans;\n    }\n};\n```
['C', 'C++']