You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: leetcode/1501-1600/1542.Find-Longest-Awesome-Substring/README.md
+17-13Lines changed: 17 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,32 @@
1
1
# [1542.Find Longest Awesome Substring][title]
2
2
3
-
> [!WARNING|style:flat]
4
-
> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm)
5
-
6
3
## Description
4
+
You are given a string `s`. An **awesome** substring is a non-empty substring of `s` such that we can make any number of swaps in order to make it a palindrome.
5
+
6
+
Return the length of the maximum length **awesome substring** of `s`.
7
7
8
8
**Example 1:**
9
9
10
10
```
11
-
Input: a = "11", b = "1"
12
-
Output: "100"
11
+
Input: s = "3242415"
12
+
Output: 5
13
+
Explanation: "24241" is the longest awesome substring, we can form the palindrome "24142" with some swaps.
13
14
```
14
15
15
-
## 题意
16
-
> ...
16
+
**Example 2:**
17
17
18
-
## 题解
19
-
20
-
### 思路1
21
-
> ...
22
-
Find Longest Awesome Substring
23
-
```go
18
+
```
19
+
Input: s = "12345678"
20
+
Output: 1
24
21
```
25
22
23
+
**Example 3:**
24
+
25
+
```
26
+
Input: s = "213123"
27
+
Output: 6
28
+
Explanation: "213123" is the longest awesome substring, we can form the palindrome "231132" with some swaps.
0 commit comments