labuladong / fucking-algorithm

刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.

Home Page:https://labuladong.github.io/algo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug][{python}] {serialize-and-deserialize-binary-tree}

LzMingYueShanPao opened this issue · comments

请在提交 bug 之前先搜索

  • 我已经搜索过 issues,没有发现相同的 bug。

出错的题目链接

https://leetcode.cn/problems/serialize-and-deserialize-binary-tree/

报错信息

AttributeError: 'NoneType' object has no attribute 'append'

在python中sb是空列表,不能连续进行append操作,需要分两步进行append,如:
sb.append(self.NULL)
sb.append(self.SEP)

你是否愿意提交 PR 修复这个 bug?

  • 我愿意!