<awangdev>1216. Valid Palindrome III_1.java
private int findLpsLength(String s) {

        int n = s.length();
        int[][] dp = new int[n][n];
        for (int i = n - 1; i >= 0; i--){
            dp[i][i] = 1;
            for (int j = i + 1; j < n; j++) {
                if (s.charAt(i) == s.charAt(j)) dp[i][j] = dp[i + 1][j - 1] + 2;
                else dp[i][j] = Math.max(dp[i + 1][j], dp[i][j - 1]);
            }
        }
        return dp[0][n - 1];
    }
private int sample_funcname ( String var_1 ) {
  int var_3 = var_1 . length ( ) ;
  int [ ] [ ] var_4 = new int [ var_3 ] [ var_3 ] ;
  for ( int var_6 = var_3 - 1 ;
  var_6 >= 0 ;
  var_6 -- ) {
    var_4 [ var_6 ] [ var_6 ] = 1 ;
    for ( int var_8 = var_6 + 1 ;
    var_8 < var_3 ;
    var_8 ++ ) {
      if ( var_1 . charAt ( var_6 ) == var_1 . charAt ( var_8 ) ) var_4 [ var_6 ] [ var_8 ] = var_4 [ var_6 + 1 ] [ var_8 - 1 ] + 2 ;
      else var_4 [ var_6 ] [ var_8 ] = Math . max ( var_4 [ var_6 + 1 ] [ var_8 ] , var_4 [ var_6 ] [ var_8 - 1 ] ) ;
    }
  }
  return var_4 [ 0 ] [ var_3 - 1 ] ;
}
