[Java] Longest Common Subsequence Solution - Clean code
Idea\n- If we know the longest palindromic sub-sequence is x and the length of the string is n then, what is the answer to this problem? It is n - x as we need 
**Idea**\n- If we know the longest palindromic sub-sequence is `x` and the length of the string is `n` then, what is the answer to this problem? It is `n - x` as we need `n - x` insertions to make the remaining characters also palindrome.\n\n```java\nclass Solution {\n    public int minInsertions(String s) {\n        String sReverse = new StringBuilder(s).reverse().toString();\n        int lcs = longestCommonSubsequence(s.toCharArray(), sReverse.toCharArray());\n        return s.length() - lcs;\n    }\n\n    private int longestCommonSubsequence(char[] arr1, char[] arr2) {\n        int n1 = arr1.length, n2 = arr2.length;\n        int[][] dp = new int[n1 + 1][n2 + 1];\n        for (int i = 1; i <= n1; i++) {\n            for (int j = 1; j <= n2; j++) {\n                if (arr1[i - 1] == arr2[j - 1]) {\n                    dp[i][j] = dp[i - 1][j - 1] + 1;\n                } else {\n                    dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);\n                }\n            }\n        }\n        return dp[n1][n2];\n    }\n}\n```\nComplexity:\n- Time: `O(n^2)`, `n` is the length of string `s`\n- Space: `O(n^2)`
[]