I found a bug in testCase

  • 0

    I was told to invert the binary tree , like inverting [1,2,3] to [1,3,2].
    when i input

    if root == None:
        return None
    root.left = root.right     # i should use a temp node to help instead
    return root

    clearly it's wrong.so it invert [1,2,3] to [1,2,3].

    However it just accepted.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.