From 618d07e63c5d401fca5a9302e9c95a71b3653cf0 Mon Sep 17 00:00:00 2001 From: Samuel Huang Date: Fri, 1 Aug 2025 04:12:19 -0700 Subject: [PATCH] Delete kotlin/1143-Longest-Common-Subsequence.kt The rationale for doing this is because is there is a similarly named file `1143-longest-common-subsequence.kt` in the same directory, which has name conflicts with the upper-cased one --- kotlin/1143-Longest-Common-Subsequence.kt | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 kotlin/1143-Longest-Common-Subsequence.kt diff --git a/kotlin/1143-Longest-Common-Subsequence.kt b/kotlin/1143-Longest-Common-Subsequence.kt deleted file mode 100644 index ea744645e..000000000 --- a/kotlin/1143-Longest-Common-Subsequence.kt +++ /dev/null @@ -1,23 +0,0 @@ -class Solution { - fun longestCommonSubsequence(text1: String, text2: String): Int { - if (text1.isEmpty() || text2.isEmpty()) { - return 0 - } - - val M = text1.length - val N = text2.length - - val dp = Array(M + 1){IntArray(N + 1){0}} - - for (i in 1..M) { - for (j in 1..N) { - if (text1[i - 1] == text2[j - 1]) { - dp[i][j] = dp[i - 1][j - 1] + 1 - } else { - dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]) - } - } - } - return dp[M][N] - } -} \ No newline at end of file