Minimum Deletions , Form A Palindrome Geeks For Geeks
For Both Questions Code Is Same: MINIMUM DELETIONS: class Solution{ static int minimumNumberOfDeletions(String s1) { StringBuilder sb=new StringBuilder(); sb.append(s1); String s2=sb.reverse().toString(); int n=s2.length(); int t[][]=new int[n+1][n+1]; for(int i=0;i<n+1;i++){ for(int j=0;j<n+1;j++){ if(i==0 || j==0){ t[i][j]=0; } } } for(int i=1;i<n+1;i++){ ...