摘要:
给你一个字符串 s,找到 s 中最长的回文子串。 https://leetcode-cn.com/problems/longest-palindromic-substring/ 最新解法:奇偶分别向两端扩展 public String longestPalindrome(String s) { in 阅读全文
摘要:
给你一个 m 行 n 列的矩阵 matrix ,请按照 顺时针螺旋顺序 ,返回矩阵中的所有元素。 解答:while循环内部不满足也会继续走到结尾 import java.util.ArrayList; public class Solution { public ArrayList<Integer> 阅读全文
摘要:
描述 给定两个字符串str1和str2,输出两个字符串的最长公共子序列。如果最长公共子序列为空,则返回"-1"。目前给出的数据,仅仅会存在一个最长的公共子序列 方法1: import java.util.*; public class Solution { /** * longest common 阅读全文