题目:
题解:
class Solution:def findLUSlength(self, strs: List[str]) -> int:def is_subseq(s: str, t: str) -> bool:pt_s = pt_t = 0while pt_s < len(s) and pt_t < len(t):if s[pt_s] == t[pt_t]:pt_s += 1pt_t += 1return pt_s == len(s)ans = -1for i, s in enumerate(strs):check = Truefor j, t in enumerate(strs):if i != j and is_subseq(s, t):check = Falsebreakif check:ans = max(ans, len(s))return ans