I have written working solution when I am testing assuming the input for root is a TreeNode. However when I run it on this website, it says the input was an array [1,2]. What does that mean? I thought type root was a TreeNode?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.