Beats 90.48% | DP java Solution | O(n^2)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n^2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n^2)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public String findTheString(int[][] lcp) {\n        \n        int n = lcp.length;\n        char arr[] = new char[n];\n        arr[0] = \'a\';\n\n        for(int i = 1; i < n; i++){\n            char test = \'a\';\n            boolean found = false;\n\n            for(int j = 0; j < i; j++){\n                test = (char)Math.max(test, arr[j]);\n\n                if(lcp[i][j] != 0){\n                    found = true;\n                    arr[i] = arr[j];\n                    break;\n                }\n            }\n\n            if(found)\n                continue;\n\n            arr[i] = (char)(++test);\n\n            if(test > \'z\')\n                return "";\n        }\n\n\n        int dp[][] = new int[n+1][n+1];\n        \n        for(int i = n-1; i >= 0; i--){\n            for(int j = n-1; j >= 0; j--){\n                int val = 0;\n\n                if(arr[i] == arr[j]){\n                    val = 1 + dp[i+1][j+1];\n                }\n                dp[i][j] = val;\n            }\n        }\n\n        for(int i = 0; i < n; i++){\n            for(int j = 0; j < n; j++){\n                \n                if(dp[i][j] != lcp[i][j])\n                    return "";\n            }\n        }\n\n        StringBuilder result = new StringBuilder();\n        for(char ch : arr)\n            result.append(ch);\n\n        return result.toString();\n    }\n}\n```
['Java']