Code: https://ide.codingblocks.com/s/234177
Getting WA for all tc and sample cases.
though the sample case does run on my local but shows no output when using custom input in coding blocks ide.
Code: https://ide.codingblocks.com/s/234177
Getting WA for all tc and sample cases.
though the sample case does run on my local but shows no output when using custom input in coding blocks ide.
hi @Avi-Kasliwal-315786729062203 it is mentioned that max number of children will be 2 only so you can work with a binary tree 
I made a BT only now
1 2
2 1
3 2
4 0
5 0
6 2
7 0
8 1
9 0
2 [0 to 3]
and also the sample case given in the question.
@Avi-Kasliwal-315786729062203 the program is giving output upon removing these lines from the code #ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif
@Ishitagambhir thanks, got AC 
I never used to remove those lines earlier and they always worked. donno what happen today