更新
This commit is contained in:
@@ -72,21 +72,22 @@ public class StringUtils {
|
||||
int[][] matrix = new int[m + 1][n + 1];
|
||||
for (int i = 1; i <= m; i++) {
|
||||
for (int j = 1; j <= n; j++) {
|
||||
if (chars_strA[i - 1] == chars_strB[j - 1])
|
||||
if (chars_strA[i - 1] == chars_strB[j - 1]) {
|
||||
matrix[i][j] = matrix[i - 1][j - 1] + 1;
|
||||
else
|
||||
} else {
|
||||
matrix[i][j] = Math.max(matrix[i][j - 1], matrix[i - 1][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char[] result = new char[matrix[m][n]];
|
||||
int currentIndex = result.length - 1;
|
||||
while (matrix[m][n] != 0) {
|
||||
if (matrix[n] == matrix[n - 1])
|
||||
if (matrix[n] == matrix[n - 1]) {
|
||||
n--;
|
||||
else if (matrix[m][n] == matrix[m - 1][n])
|
||||
} else if (matrix[m][n] == matrix[m - 1][n]) {
|
||||
m--;
|
||||
else {
|
||||
} else {
|
||||
result[currentIndex] = chars_strA[m - 1];
|
||||
currentIndex--;
|
||||
n--;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class Language2Book implements Language2Line {
|
||||
// 遍历内容
|
||||
for (String line : list) {
|
||||
// 翻页
|
||||
if (line.equals("[page]")) {
|
||||
if ("[page]".equals(line)) {
|
||||
book.addPages(page.build());
|
||||
page = new PageBuilder();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Language2Json implements Language2Line {
|
||||
clickEvent = new OpenUrlEvent(message.substring(KEY_URL.length()));
|
||||
}
|
||||
// 换行
|
||||
else if (message.equals("[break]")) {
|
||||
else if ("[break]".equals(message)) {
|
||||
append(current, clickEvent, hoverEvent);
|
||||
// 删除动作
|
||||
clickEvent = null;
|
||||
|
||||
Reference in New Issue
Block a user