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: app/docs/CommunityShare/Leetcode/2131. 连接两字母单词得到的最长回文串.md
+29-27Lines changed: 29 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
---
2
2
title: 2131. 连接两字母单词得到的最长回文串.md
3
-
date: '2025/5/25-2:33'
3
+
date: "2025/5/25-2:33"
4
4
tags:
5
5
- - Python
6
6
- - Answer
7
7
abbrlink: 9fa195e5
8
+
docId: ksw2vic4alf1tdnnueay81g8
8
9
---
9
10
10
11
# QUESTION:
@@ -34,18 +35,18 @@ Example:
34
35
35
36
5. Second "gg" finds "gg" exists → use "gg" + "gg" as a pair → res += 4 → map becomes { "lc": 0, "gg": 0 }
36
37
37
-
Then we check whether the hash map contains any palindromic word (i.e., a word with two identical characters) that can be used as the center of the final palindrome string.
38
-
If such a word exists, we can add 2 more to the result.
38
+
Then we check whether the hash map contains any palindromic word (i.e., a word with two identical characters) that can be used as the center of the final palindrome string.
39
+
If such a word exists, we can add 2 more to the result.
39
40
40
41
6. Finding a center word (can only pick one symmetric word)
41
-
⚠️ In this example, all "gg" words have been paired, so none is left → no center word is added.
42
-
42
+
⚠️ In this example, all "gg" words have been paired, so none is left → no center word is added.
0 commit comments