<p>Given two strings <code>s1</code> and&nbsp;<code>s2</code>, return <em>the lowest <strong>ASCII</strong> sum of deleted characters to make two strings equal</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> s1 = &quot;sea&quot;, s2 = &quot;eat&quot;
<strong>Output:</strong> 231
<strong>Explanation:</strong> Deleting &quot;s&quot; from &quot;sea&quot; adds the ASCII value of &quot;s&quot; (115) to the sum.
Deleting &quot;t&quot; from &quot;eat&quot; adds 116 to the sum.
At the end, both strings are equal, and 115 + 116 = 231 is the minimum sum possible to achieve this.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> s1 = &quot;delete&quot;, s2 = &quot;leet&quot;
<strong>Output:</strong> 403
<strong>Explanation:</strong> Deleting &quot;dee&quot; from &quot;delete&quot; to turn the string into &quot;let&quot;,
adds 100[d] + 101[e] + 101[e] to the sum.
Deleting &quot;e&quot; from &quot;leet&quot; adds 101[e] to the sum.
At the end, both strings are equal to &quot;let&quot;, and the answer is 100+101+101+101 = 403.
If instead we turned both strings into &quot;lee&quot; or &quot;eet&quot;, we would get answers of 433 or 417, which are higher.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= s1.length, s2.length &lt;= 1000</code></li>
	<li><code>s1</code> and <code>s2</code> consist of lowercase English letters.</li>
</ul>

class Solution {
public:
int dp[1001][1001];
vector<int>aa,bb;
string a,b;
int solve(int i,int j){
 if(i==a.size()){
    int ans=0;
    
    return dp[i][j]=bb[j];
 }
 if(j==b.size()){
  
   
    return dp[i][j]=aa[i];
 }
if(dp[i][j]<INT_MAX){
return dp[i][j];
}
if(a[i]==b[j]){
    return dp[i][j]=solve(i+1,j+1);
}
int ans=min({solve(i+1,j)+a[i],solve(i,j+1)+b[j]});


return dp[i][j]=ans;


}
    int minimumDeleteSum(string &s1, string &s2) {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        a=s1;b=s2;
        
        int n=s1.size(),m=s2.size();
        aa.resize(n+1);aa[n]=0;
        bb.resize(m+1);bb[m]=0;
        
        for(int i=n-1;i>=0;i--){
            aa[i]=aa[i+1]+s1[i];
        }
        
        for(int i=m-1;i>=0;i--){
            bb[i]=bb[i+1]+s2[i];
        }
            for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                dp[i][j]=INT_MAX;
            }
        }
return solve(0,0);



    }
};
14000