1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| // @Title: 最长特殊序列 Ⅰ (Longest Uncommon Subsequence I)
// @Author: 15816537946@163.com
// @Date: 2022-03-05 10:36:01
// @Runtime: 0 ms
// @Memory: 1.9 MB
func findLUSlength(a string, b string) int {
i, j := len(a),len(b)
if i > j {
return i
} else if i < j {
return j
}
if a == b {
return -1
}
return i
}
|