We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c6cc66 commit 929ce5dCopy full SHA for 929ce5d
src/main/java/com/fishercoder/solutions/_516.java
@@ -22,7 +22,7 @@
22
public class _516 {
23
24
/**Inspired by https://discuss.leetcode.com/topic/78603/straight-forward-java-dp-solution*/
25
- public int longestPalindromeSubseq(String s) {
+ public static int longestPalindromeSubseq(String s) {
26
int[][] dp = new int[s.length()][s.length()];
27
for (int i = s.length()-1; i >= 0; i--) {
28
dp[i][i] = 1;//initialization
@@ -37,4 +37,9 @@ public int longestPalindromeSubseq(String s) {
37
return dp[0][s.length()-1];
38
}
39
40
+ public static void main(String... args) {
41
+ longestPalindromeSubseq("bbbab");
42
+ System.out.println("Done.");
43
+ }
44
+
45
0 commit comments