generated from filipe1309/shubcogen-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
cases.ts
38 lines (38 loc) · 2.03 KB
/
cases.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export default [
{
input: {value:1,left:{value:2,left:{value:4,left:{value:8,left:null,right:null},right:{value:9,left:null,right:null}},right:{value:5,left:null,right:null}},right:{value:3,left:{value:6,left:null,right:null},right:{value:7,left:null,right:null}}},
expected: 16
},
{
input: {value:1,left:null,right:null},
expected: 0
},
{
input: {value:1,left:{value:2,left:null,right:null},right:null},
expected: 1
},
{
input: {value:1,left:{value:2,left:null,right:null},right:{value:3,left:null,right:null}},
expected: 2
},
{
input: {value:1,left:{value:2,left:{value:4,left:null,right:null},right:null},right:{value:3,left:null,right:null}},
expected: 4
},
{
input: {value:1,left:{value:2,left:{value:3,left:{value:4,left:{value:5,left:{value:6,left:null,right:{value:7,left:null,right:null}},right:null},right:null},right:null},right:null},right:null},
expected: 21
},
{
input: {value:1,left:{value:2,left:{value:3,left:{value:4,left:{value:5,left:{value:6,left:null,right:{value:7,left:null,right:null}},right:null},right:null},right:null},right:null},right:{value:8,left:null,right:{value:9,left:null,right:{value:10,left:null,right:{value:11,left:null,right:{value:12,left:{value:13,left:null,right:null},right:null}}}}}},
expected: 42
},
{
input: {value:1,left:{value:2,left:{value:4,left:{value:8,left:null,right:null},right:{value:9,left:null,right:null}},right:{value:5,left:null,right:null}},right:{value:3,left:{value:6,left:{value:10,left:null,right:{value:11,left:{value:12,left:{value:14,left:null,right:null},right:null},right:{value:13,left:{value:15,left:null,right:null},right:{value:16,left:null,right:null}}}},right:null},right:{value:7,left:null,right:null}}},
expected: 51
},
{
input: {value:1,left:{value:2,left:{value:3,left:{value:4,left:{value:5,left:{value:6,left:{value:7,left:{value:8,left:{value:9,left:null,right:null},right:null},right:null},right:null},right:null},right:null},right:null},right:null},right:null},
expected: 36
}
];