About
count = 0 count1 = 0 count2 = 0
for i in preorder:
for j in postorder:
if i == j:
count = count + 1
for i in postorder:
for j in inorder:
if i == j:
count1 = count1 + 1
for i in preorder:
for j in inorder:
if i == j:
count2 = count2 + 1
if count == length and count1 == length and count2 == length:
return 1
else:
return 0