Merge branch 'master' of github.com:youngyangyang04/leetcode-master

This commit is contained in:
programmercarl
2022-09-16 09:40:32 +08:00
22 changed files with 445 additions and 189 deletions

View File

@@ -233,7 +233,7 @@ class Solution:
else: # 逐一处理节点
cur = stack.pop()
if pre: # 当前节点和前节点的值的差值
result = min(result, cur.val - pre.val)
result = min(result, abs(cur.val - pre.val))
pre = cur
cur = cur.right
return result