Hello. i've been trying to solve this problem where you need to turn a tree into a string format.
But I don't understand what the list is supposed to contain.
https://preview.redd.it/s1kgh4h6j69e1.png?width=271&format=png&auto=webp&s=0dfd96225712589d144535e0613e68ff644d53ab
The leetcode website says it is not an array, but if i return an array of nodes, or integers, i get an "invalid returned data" error
in my last 2 lines of the serialize i have:
print (finalanswer)
return final
print (finalanswer)
return final
to which i get
[1, 2, 3, None, None, 4, 5]
Output"Invalid returned data."
Expected[1,2,3,null,null,4,5]
but if i convert to s