<gouthampradhan>dynamic_programming_LongestPaliandromicSubstring_1.java
public String longestPalindrome(String s) {
    int l = s.length();
    int startIndex = 0;
    int maxLen = 1;
    boolean[][] A = new boolean[l][l];
    for (int i = 0, j = 0; i < l; i++, j++) A[i][j] = true;
    for (int i = 0, j = i + 1; j < l; i++, j++) {
      if (s.charAt(i) == s.charAt(j)) {
        A[i][j] = true;
        startIndex = i;
        maxLen = 2;
      }
    }
    for (int k = 3; k <= l; k++) {
      for (int i = 0, j = k - 1; j < l; i++, j++) {
        if (s.charAt(i) == s.charAt(j)) {
          A[i][j] = A[i + 1][j - 1];
          if (A[i][j]) {
            if (k > maxLen) {
              startIndex = i;
              maxLen = k;
            }
          }
        }
      }
    }
    return s.substring(startIndex, startIndex + maxLen);
  }
public String var_0 ( String var_2 ) {
  int var_4 = var_2 . length ( ) ;
  int var_6 = 0 ;
  int var_8 = 1 ;
  boolean [ ] [ ] var_10 = new boolean [ var_4 ] [ var_4 ] ;
  for ( int var_11 = 0 , var_12 = 0 ;
  var_11 < var_4 ;
  var_11 ++ , var_12 ++ ) var_10 [ var_11 ] [ var_12 ] = true ;
  for ( int var_11 = 0 , var_12 = var_11 + 1 ;
  var_12 < var_4 ;
  var_11 ++ , var_12 ++ ) {
    if ( var_2 . charAt ( var_11 ) == var_2 . charAt ( var_12 ) ) {
      var_10 [ var_11 ] [ var_12 ] = true ;
      var_6 = var_11 ;
      var_8 = 2 ;
    }
  }
  for ( int var_16 = 3 ;
  var_16 <= var_4 ;
  var_16 ++ ) {
    for ( int var_11 = 0 , var_12 = var_16 - 1 ;
    var_12 < var_4 ;
    var_11 ++ , var_12 ++ ) {
      if ( var_2 . charAt ( var_11 ) == var_2 . charAt ( var_12 ) ) {
        var_10 [ var_11 ] [ var_12 ] = var_10 [ var_11 + 1 ] [ var_12 - 1 ] ;
        if ( var_10 [ var_11 ] [ var_12 ] ) {
          if ( var_16 > var_8 ) {
            var_6 = var_11 ;
            var_8 = var_16 ;
          }
        }
      }
    }
  }
  return var_2 . substring ( var_6 , var_6 + var_8 ) ;
}
