Question: https://leetcode.com/problems/binary-...
SQL Schema:
Create table If Not Exists Tree (N int,P int)
Truncate table Tree
insert into Tree (N, P) values ('1', '2')
insert into Tree (N, P) values ('3', '2')
insert into Tree (N, P) values ('6', '8')
insert into Tree (N, P) values ('9', '8')
insert into Tree (N, P) values ('2', '5')
insert into Tree (N, P) values ('8', '5')
insert into Tree (N, P) values ('5', 'None')
Pandas Schema:
data = [[1, 2], [3, 2], [6, 8], [9, 8], [2, 5], [8, 5], [5, None]]
tree = pd.DataFrame(data, columns=['N', 'P']).astype({'N':'Int64', 'P':'Int64'})
#leetcodesolutions #datascience #sql