-
在LeetCode的第325题中,Python的LC解决方案提供了Python 3版本::heart_suit::heart_suit:
资源介绍
leetcode中325题python
Python
Solutions
for
Leetcode
solutions
list,
continuing
update.
:heart_suit:
means
you
need
a
subscription.
#
Title
Difficulty
Basic
idea
Solution
1
Easy
1.
暴力解法.
2.字典解法.
2
Medium
1.
l1、l2对应位+进位位作为root.next结点.
3
Medium
1.
两种做法,
若s[i]在dic中且start
<=
dic[s[i]],
则更新start,
否则ans
=
max(ans,
i
-
start
+
1)
2.
若v不在dic或者即使v在dic但dic[v]
<
start:
ans
=
max(ans,
i
-
start
+
1)
否则start
=
dic[v]
+
1.
5
Medium
1.
对每一位字母调用help,
即以该字母为中心,向两边扩开,
条件s[l]==s[r]
2.两种情况都要考虑到,
s为奇数个,
s为偶数个.
11
Medium
1.
left,