File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ function minDistance(word1: string, word2: string): number {
364
364
365
365
C:
366
366
367
+
367
368
``` c
368
369
int min (int num1, int num2, int num3) {
369
370
return num1 > num2 ? (num2 > num3 ? num3 : num2) : (num1 > num3 ? num3 : num1);
@@ -376,7 +377,7 @@ int minDistance(char * word1, char * word2){
376
377
for (int i = 1; i <= strlen(word2); i++) dp[ 0] [ i ] = i;
377
378
378
379
for (int i = 1; i <= strlen(word1); i++) {
379
- for (int j = 1; j <=strlen(word2); j++) {
380
+ for (int j = 1; j <= strlen(word2); j++) {
380
381
if (word1[i-1] == word2[j-1]) {
381
382
dp[i][j] = dp[i-1][j-1];
382
383
}
@@ -389,7 +390,5 @@ int minDistance(char * word1, char * word2){
389
390
}
390
391
```
391
392
392
-
393
-
394
393
-----------------------
395
394
<div align="center"><img src=https://code-thinking.cdn.bcebos.com/pics/01二维码一.jpg width=500> </img></div>
You can’t perform that action at this time.
0 commit comments