Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 018c9cb

Browse files
新增java 2-D array 建議
1 parent ff3f402 commit 018c9cb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎problems/1143.最长公共子序列.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ Java:
144144
*/
145145
class Solution {
146146
public int longestCommonSubsequence(String text1, String text2) {
147+
// char[] char1 = text1.toCharArray();
148+
// char[] char2 = text2.toCharArray();
149+
// 可以在一開始的時候就先把text1, text2 轉成char[],之後就不需要有這麼多爲了處理字串的調整
150+
// 就可以和卡哥的code更一致
151+
147152
int[][] dp = new int[text1.length() + 1][text2.length() + 1]; // 先对dp数组做初始化操作
148153
for (int i = 1 ; i <= text1.length() ; i++) {
149154
char char1 = text1.charAt(i - 1);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /